Click here to Skip to main content
15,903,362 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Logout Problem in forms authentication Pin
SreejithAchutan13-Mar-09 0:28
SreejithAchutan13-Mar-09 0:28 
Questionexport image from sql 2005 to excel Pin
tw-de12-Mar-09 22:32
tw-de12-Mar-09 22:32 
AnswerRe: export image from sql 2005 to excel Pin
Christian Graus12-Mar-09 22:42
protectorChristian Graus12-Mar-09 22:42 
QuestionHelp with a Logic Pin
Vimalsoft(Pty) Ltd12-Mar-09 20:45
professionalVimalsoft(Pty) Ltd12-Mar-09 20:45 
AnswerRe: Help with a Logic Pin
Christian Graus12-Mar-09 22:31
protectorChristian Graus12-Mar-09 22:31 
GeneralRe: Help with a Logic Pin
Vimalsoft(Pty) Ltd12-Mar-09 22:36
professionalVimalsoft(Pty) Ltd12-Mar-09 22:36 
GeneralRe: Help with a Logic Pin
Christian Graus12-Mar-09 22:43
protectorChristian Graus12-Mar-09 22:43 
GeneralRe: Help with a Logic Pin
Vimalsoft(Pty) Ltd15-Mar-09 20:50
professionalVimalsoft(Pty) Ltd15-Mar-09 20:50 
Good Morning Chris

Thanks for your help, i have added an extra if statement like this and it worked

protected void setupGrid()
    {
        if (((int)Session["numCycles"]) > 0)
        {
            UltraWebGrid cycleGrid = ultraGridCycles;
            int numCols = 0; //Number of Colums             
            int numRows = 0; //Number of Rows

            //If the Sessions are Greater than 13 , Make 
            //the Columns to be 13 else keep the supplied value for the Columns
            if (((int)Session["numCycles"]) >= 13)
            {
                numCols = 13;
            }
            else
            {  //Keep the Columns as they are 
                numCols = ((int)Session["numCycles"]);
            }


            /*This one is used for the Row not the Column like the above one*/
            //Divide the Session variable Value by 13, the Returned 
            //number is Checked if its 0 if that is true the First Statement get executed 
            //else the second -->
            //I suppose this was meant to check the zero, because you cant divide by zero
            if ((((int)Session["numCycles"]) % 13) == 0)
            {
                //Assign the value of a Session Varable that is Devided by 13
                numRows = (int)(((int)Session["numCycles"]) / 13);
            }
            else
            {
                //Assign the value of a session variable and Divide it by 13 
                //add a on top of it. 
                numRows = (int)((((int)Session["numCycles"]) / 13) + 1);
            }

            //Change the Height of the Grid
            cycleGrid.Height = Unit.Pixel(20 * numRows + 6);

            /*'''''''''''''''''''''''''''''''''''''''''''
             * For the Column
             * ''''''''''''''''''''''''''''''''''''''''''*/

            /*This is a For Loop. We First declare 
             * the integer and initialize it to 0 and the second one is
             * the expression, we say, as long as the number of [i] variable are less than the number of columns
             * then increase the value of i
             */
            for (int i = 0; i < numCols; i++)
            {   //Create an object of a class Ultracolumn that represents the Column
                UltraGridColumn col = new UltraGridColumn(true);
                //adjust the Width of the Column
                col.Width = Unit.Pixel(10);
                //Its a Unique String in a Gridview
                col.Key = i.ToString();
                //Now we are adding Columns in the Gridview by passing the Column object.
                cycleGrid.Columns.Add(col);
            }

            /*'''''''''''''''''''''''''''''''''''''''''''
             * For the Rows
             * ''''''''''''''''''''''''''''''''''''''''''*/
            /*Here we are using the For loop,
             * First declare and initializing the variable i 
             * and while the variable i is less than the number of rows then increase 
             * the value of i */
            for (int i = 1; i <= numRows; i++)
            {
                //Create an object of a Class UltragridRow and initialize it
                UltraGridRow row = new UltraGridRow(true);
                //Assign a unique key of a row
                row.Key = i.ToString();

                /*'''''''''''''''''''''''''''''''''''''''''''
                * For the Cell
                * ''''''''''''''''''''''''''''''''''''''''''*/
                /*Declare a Variable of integer "j" and assign it a value of "1"
                 * and as long as the value of J is less that and equal to number of Columns
                 * then increament the value of a variable J
                 */
                for (int j = 1; j <= numCols; j++)
                {
                    //Create an object of a class UltraGridCell and initialize it.
                    UltraGridCell cell = new UltraGridCell(true);
                    //adjust the gridproperties
                    cell.Style.HorizontalAlign = HorizontalAlign.Center;
                    //adjust the gridproperties
                    cell.Style.Padding.Left = 0;
                    //adjust the gridproperties
                    cell.Style.Padding.Top = 0;
                    //adjust the gridproperties
                    cell.Style.Padding.Bottom = 0;
                    //adjust the gridproperties
                    cell.Style.Padding.Right = 0;
                    //adjust the gridproperties

                    //Adjust the Cell Value to Integer 13 mutiply by number of rows -1 ajd pluss number of Columns
                    cell.Value = (int)((13 * (i - 1)) + j);

                    /*If 13 multiply by number of rows -1 one plus number of Columns
                     * is greateer than the session variable then set the value of that cell to null */
                    if (((13 * (i - 1)) + j) > ((int)Session["numCycles"]))
                    {
                        cell.Value = null;
                        cell.Style.BackColor = System.Drawing.Color.Gray;
                        cell.AllowEditing = AllowEditing.No;
                    }

                    //add the cells to the Grid                                       
                    row.Cells.Add(cell);



                }
                cycleGrid.Rows.Add(row);

            }
            /*After the Grid has been Populated, let us remove some of the cells 
                    * using the Following code
                    */
            ArrayList array = (ArrayList)Disable_Grid();



            //Count the Number of rows in a gridview and initialize the integer with those values
            int u = cycleGrid.Rows.Count;

            /*Another For Loop,First we declare an Interger variable "i" and 
        * initialize it with "0" and as long as the variable i is less than the number of
        * rows in a gridview increament the variable i
        */
            for (int i = 0; i < cycleGrid.Rows.Count; i++)
            {
                /*Creating an object of a Class GridViewRow "g" and 
             * passing the Value a Variable i that has 
             * been checked as less than the Value of the Rows 
             */

                UltraGridRow g = cycleGrid.Rows[i];
                /*Another For Loop. Initialization of a newly declared variable 
             *  j to "0" and as long as the number of Cells are less than the variable J then increase the Value of a 
             * variable J
             */
                for (int j = 0; j < g.Cells.Count; j++)
                {
                    /*for Loop in a For loop. Declare an Integer "p" and Assign 
                     * 0 to it and as long as the number of p variable  are 
                     * less than the number of indexes in the array list variable
                      if its true the value of P is incremented by 1*/
                    for (int p = 0; p < array.Count; p++)
                    {
                        /*A String is Declared and is Assigned a value of 
                         * of a cell indexed by the variable J that is not supposed greater than
                         * the number of cells in a grid
                         */
                        string txt = g.Cells[j].Text;
                        /*if then value in the text is equal to the value of the array 
                         * make the cell invisible*/
                          if (txt != array[p].ToString())
                            {
                                /*The I is representing the Rows and the J is representing the Cells
                                 */
                                //These are the Cells that are Supposed to be disabled
                                
                                cycleGrid.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.Gray;
                                
                            }
                            else
                            {
                                cycleGrid.Rows[i].Cells[j].Style.Cursor = Infragistics.WebUI.Shared.Cursors.Auto;
                             
                                cycleGrid.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.Black;
                                
                                cycleGrid.Rows[i].Cells[j].Style.Font.Bold = true;

                             }
                        
                        }
                        if (cycleGrid.Rows[i].Cells[j].Style.Font.Bold == true)
                        {
                            cycleGrid.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.Black;
                        }
                        else
                        {
                             cycleGrid.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.Gray;
                             cycleGrid.Rows[i].Cells[j].Style.BackColor = System.Drawing.Color.DarkGray;
                             
                            cycleGrid.Rows[i].Cells[j].Style.Cursor = Infragistics.WebUI.Shared.Cursors.Wait;

                        }

                    }
                
            }
        }

        
    }


And its working thank you

Vuyiswa Maseko,

Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za

QuestionWeb Service 400 Error Pin
Expert Coming12-Mar-09 20:30
Expert Coming12-Mar-09 20:30 
AnswerRe: Web Service 400 Error Pin
Abhijit Jana12-Mar-09 20:43
professionalAbhijit Jana12-Mar-09 20:43 
GeneralRe: Web Service 400 Error Pin
Expert Coming13-Mar-09 14:15
Expert Coming13-Mar-09 14:15 
GeneralRe: Web Service 400 Error Pin
Expert Coming13-Mar-09 14:31
Expert Coming13-Mar-09 14:31 
QuestionDatagrid problem Pin
rakeshs31212-Mar-09 19:23
rakeshs31212-Mar-09 19:23 
AnswerRe: Datagrid problem Pin
Abhijit Jana12-Mar-09 19:33
professionalAbhijit Jana12-Mar-09 19:33 
GeneralRe: Datagrid problem Pin
rakeshs31212-Mar-09 21:35
rakeshs31212-Mar-09 21:35 
AnswerRe: Datagrid problem Pin
kumar_k50812-Mar-09 19:42
kumar_k50812-Mar-09 19:42 
GeneralRe: Datagrid problem Pin
rakeshs31212-Mar-09 21:34
rakeshs31212-Mar-09 21:34 
Questioncan i use a class created by xsd. Pin
prasadbuddhika12-Mar-09 19:20
prasadbuddhika12-Mar-09 19:20 
AnswerRe: can i use a class created by xsd. Pin
Christian Graus12-Mar-09 22:32
protectorChristian Graus12-Mar-09 22:32 
GeneralRe: can i use a class created by xsd. Pin
prasadbuddhika13-Mar-09 0:19
prasadbuddhika13-Mar-09 0:19 
GeneralRe: can i use a class created by xsd. Pin
prasadbuddhika13-Mar-09 1:09
prasadbuddhika13-Mar-09 1:09 
GeneralRe: can i use a class created by xsd. Pin
Ashfield13-Mar-09 2:25
Ashfield13-Mar-09 2:25 
QuestionHow to apply stylesheet class in EMail HTML format Pin
Deepml12-Mar-09 19:17
Deepml12-Mar-09 19:17 
AnswerRe: How to apply stylesheet class in EMail HTML format Pin
Abhijit Jana12-Mar-09 19:32
professionalAbhijit Jana12-Mar-09 19:32 
GeneralRe: How to apply stylesheet class in EMail HTML format Pin
Deepml12-Mar-09 19:45
Deepml12-Mar-09 19:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.