Better way of making columns visible invisible

15 posts, 0 answers
  1. Bexm
    Bexm avatar
    67 posts
    Member since:
    May 2007

    Posted 07 Dec 2007 Link to this post

    Hello

    I have 74 columns in my grid view which a user can choose to view or not using the column chooser.

    On first bind of the grid it leaves about 10 of these visible but makes the rest invisible, this is making the startup of my windows app incredibly slow.., to the point that it sometimes crashes..

    I know 74 is a huge amount, but this is a business requirement to give the users the option.

    Is there anyway of doing this using the grid view and column chooser without it being so incredibly slow, or do you have any suggestions of another method I can use?

    Thanks

    Becky
  2. Pawz
    Pawz avatar
    51 posts
    Member since:
    Aug 2007

    Posted 09 Dec 2007 Link to this post

    Only thing I can think of would be to get a listing of the columns the user wants visible, and *then* build the grid, with only those columns in the grid. Then if they change the columns they want to see you'd reload & rebind the grid to the new columns. That would save you from having to load all the invisible columns..

    Is it slow with only a few records displaying? I mean, is the grid having issues managing 75 columns, or is it having issues displaying 1,000 records with 75 columns?
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Bexm
    Bexm avatar
    67 posts
    Member since:
    May 2007

    Posted 10 Dec 2007 Link to this post

    Yes it is very slow even when binding an empty grid.
    I have found something that is making it considerably quicker

    radGridView1.GridElement.BeginUpdate();
    .........
    radGridView1.GridElement.EndUpdate();

    Its not as quick as I would like, but its definitly usable but if this doesn't work, I will have to do as you suggested above.


    Thanks

    Bex

  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 10 Dec 2007 Link to this post

    Hi Bex,

    We are glad to hear that you found a resolution.

    Currently the best solution we can offer is to use the BeginUpdate .. EndUpdate construction.

    This situation is not acceptable and the problem is in our TODO list with high priority. We will provide a solution for that as soon as possible.

    In case you need further assistance, we will be glad to help you.
     

    Regards,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Bexm
    Bexm avatar
    67 posts
    Member since:
    May 2007

    Posted 10 Dec 2007 Link to this post

    Hi Jack!

    Would you post back to this thread when there is a "proper" fix available?

    Thanks

    Bex

  7. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 11 Dec 2007 Link to this post

    Hi Bexm,

    Yes, we will keep you informed on the progress with this issue.

     
    Greetings,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. Bexm
    Bexm avatar
    67 posts
    Member since:
    May 2007

    Posted 19 Dec 2007 Link to this post

    Is this in the new release by any chance?
  9. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 20 Dec 2007 Link to this post

    Hi Bexm,

    Unfortunately, we could not implement this feature in time for the Q3 release. Improving the speed of RadGridView is one of our top priorities. In the beginning of next year we will present a greatly improved version of RadGridView featuring much better performance. We will do our best in order to implement the requested feature in this release.

    Please, take a look at the Q3 release. Your feedback would be greatly appreciated.

    Greetings,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. Espen
    Espen avatar
    11 posts
    Member since:
    Jan 2008

    Posted 07 Jan 2008 Link to this post

    I did some timing testing since I was having much the same problem,
    and here is the information I got if it is any help:

    First I set the old datasource to null and create an empty table. Then I
    import rows from a datasource into my temporary table based on some rules,
    then I set the grids datasource to the temporary table, set the columns
    visible or not and fixes the header text for the columns.

    There is (at the moment) no code for ordering the columns.

    The table has 25 columns, and I import 17,467 rows into the temporary table.

    ---
    Without Begin/end update:

    Suspended layout (00:00:00)
    Cleared datasource and created empty table (00:00:00)
    Imported all rows (00:00:00.9843813)
    Sat datasource (00:00:01.2968833)
    Fixes column visibility and header text (00:00:06.2969217)
    Ordered column (00:00:00)
    Resumed layout (00:00:00)
    Total time (00:00:08.5781863)
     
    ---

    With begin/end update :

    Suspended layout (00:00:00)
    Cleared datasource and created empty table (00:00:00)
    Imported all rows (00:00:00.9687562)
    Sat datasource (00:00:01.3281335)
    Fixes column visibility and header text (00:00:00.2031263)
    Ordered column (00:00:00)
    Resumed layout (00:00:00)
    Total time (00:00:02.5000160)

    ---

    As you can see, the time consuming bit was setting the columns visible
    and setting the header text. The BeginUpdate/EndUpdate seems to have
    removed this bottleneck. However, I thought the SuspendLayout/ResumeLayout
    should have worked so it won't update when you are changing the layout, in
    this case the visibility of the colunms. So that sort of confused me until I
    read this thread and saw the begin/end thing.

  11. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 07 Jan 2008 Link to this post

    Hello Espen,

    Thank you for the detailed research.

    Currently, we are working on a new version of RadGridView which will deliver increased speed and a reduced memory footprint. For the time being, we recommend using the BeginUpdate/EndUpdate whenever more than one visual property in RadGridView is changed.

    Don't hesitate to contact us if you have further questions.

    Greetings,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  12. Marius
    Marius avatar
    16 posts
    Member since:
    Oct 2011

    Posted 29 Nov 2012 Link to this post

    Hello!
    Can you tell me, please, if this feature was implemented for the latest version?

    Thank you!
  13. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 29 Nov 2012 Link to this post


    This is a very old thread, the performance (and stability) of RadGridView has improved quite a bit in the last 3 years.

    Regards
    Erwin
  14. Marius
    Marius avatar
    16 posts
    Member since:
    Oct 2011

    Posted 29 Nov 2012 Link to this post

    Ok, I agree. But which is the  the best solution now for this problem: " I have 74 columns in my grid view which a user can choose to view or not using the column chooser. On first bind of the grid it leaves about 10 of these visible but makes the rest invisible, this is making the startup of my windows app incredibly slow.., to the point that it sometimes crashes.."

  15. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 30 Nov 2012 Link to this post

    Do you have this problem with a current version of the controls?
    I routinely have 50+ columns on grids (most of them initially invisible) with no noticeable lag.

    Of course, you should make columns visible/invisible before
    the grid initially displays and/or within BeginUpdate() / EndUpdate() or DeferRefresh()

    Personally I prefer the

    using(mygrid.DeferRefresh())
    {
          // do the stuff that potentially causes screen updates here
    }

    because it can be tricky to call EndUdate() on all code paths.

  16. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 30 Nov 2012 Link to this post

    Hi Marius,

    RadGridView uses UI virtualization and it creates visual elements only for the cells that are currently visible. That is why the row and column number is not relevant to its performance in general. It looks that there is something specific in your application which causes the delay. Please, could you open a support ticket and send us your application. We will investigate the case in detail and we will try to find the best option.

    I am looking forward to your project.
     
    All the best,
    Jack
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Back to Top
UI for WinForms is Visual Studio 2017 Ready