Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1035
LoadOnDemand with rows created in code
posted

 Is there a way to use LoadOnDemand with a grid where I want to show 300 rows (with around 10 columns) with no sub-rows?   I am adding each row in the server code.  I tried marking some rows as Hidden, but I just realized that those rows still are sent to the Client.

Here is the method I use to add rows:

                UltraGridRow newRow = new UltraGridRow(true);

                newRow.Cells.Add(new UltraGridCell());
                newRow.Cells[PROJECT_NAME_COLUMN].Text = iGCProject.Name;
                newRow.Cells[PROJECT_NAME_COLUMN].Title = "";
                newRow.Cells[PROJECT_NAME_COLUMN].Tag = objPhaseInfo;

  ...

                uwgProjectList.Rows.Add(newRow);

Also, I need to have ViewState turned on for my grid, so I can tell what cell the user clicks on.

For me it is taking 10 seconds for this grid to load.  HELP!

  • 7694
    posted

    Hello,

    You can use the property Hidden = true and hidden row. Please take a look sample code below:
        protected void Page_Load(object sender, EventArgs e)
        {
            UltraWebGrid1.Columns.Add("Key");
            for (int i = 0; i < 10; i++)
            {
                UltraGridRow newRow = new UltraGridRow();
                newRow.Cells.Add(new UltraGridCell("Value"));
                newRow.Cells[0].Text = i.ToString();
                if ((i%2)!=0)
                {
                    newRow.Hidden = true;
                }
                UltraWebGrid1.Rows.Add(newRow);
            }
        }

    Hope this helps.