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!

Parents
No Data
Reply
  • 2636
    posted

    300 rows + 10 columns should be nothing to load are you sure you data is coming out fast?

     Is there a reason why you are adding these rows via server instead of datasource= ? using a datasource
    is faster than looping through yourself.

    In general I don't allow any control (IG or otherwise) to do load on demand (via the control) anymore after extensive
    user feedback on some stuff i am doing right now (10k + users) they all prefer paging 123 at bottom and ABC at top
    with drop downs for filter, sort and group by (yes i know they can do this via headers but they just dont get it yet, so
    it is there but 9 out of 10 use the drop downs for the exact same logic).

    So what I am doing now (SQL 2005/2008) is using RowCount inside the stored procedure then allowing the user to
    say how many records they want to see at one time and build paging based on that so (a) it only pulls those records,
    (b) speeds up the controls tremendously and (c) gets rid of the overhead in general.

    On the viewstate stuff I don't have the extra page weight of the viewstate because i offload it to the database and/or
    a cache file depending on what i am doing most of my logic is built this way because of load balancing and web farms
    so even my session state is maintained in the database.

    I am using the above logic in the new email system for visualstudiotutorials.com which "hopefully" is coming online soon
    (if i get caught up on everything that is) and I am using it (while building it) for my personal email and it is pushing 12k
    worth of email (at the moment) with 9 columns. Using the above logic i can page between 40 rows at a time (default) like
    it was a windows application I have "no" delay.

    Here is what I would try in your senerio, (a) after you get your dataset and/or build your datatable etc. set the grid.datasource = mydata
    then if you need to fix data/columns/rows etc. use the initRow event to fix your data this should boost performance a bit. also I
    would highly suggest getting your viewstate out of the page and/or at least using compression on the page.

Children