This is a migrated thread and some comments may be shown as answers.

Better way of making columns visible invisible

14 Answers 243 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bexm
Top achievements
Rank 1
Bexm asked on 07 Dec 2007, 05:19 PM
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

14 Answers, 1 is accepted

Sort by
0
Pawz
Top achievements
Rank 1
answered on 10 Dec 2007, 02:38 AM
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?
0
Bexm
Top achievements
Rank 1
answered on 10 Dec 2007, 08:59 AM

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

0
Jack
Telerik team
answered on 10 Dec 2007, 01:07 PM
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
0
Bexm
Top achievements
Rank 1
answered on 10 Dec 2007, 01:12 PM
Hi Jack!

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

Thanks

Bex

0
Jack
Telerik team
answered on 11 Dec 2007, 01:03 PM
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
0
Bexm
Top achievements
Rank 1
answered on 19 Dec 2007, 03:28 PM
Is this in the new release by any chance?
0
Jack
Telerik team
answered on 20 Dec 2007, 10:40 AM
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
0
Espen
Top achievements
Rank 1
answered on 07 Jan 2008, 12:42 PM

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.

0
Jack
Telerik team
answered on 07 Jan 2008, 04:42 PM
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
0
Marius
Top achievements
Rank 1
answered on 29 Nov 2012, 09:16 AM
Hello!
Can you tell me, please, if this feature was implemented for the latest version?

Thank you!
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 29 Nov 2012, 12:29 PM

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

Regards
Erwin
0
Marius
Top achievements
Rank 1
answered on 29 Nov 2012, 12:39 PM
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.."

0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 30 Nov 2012, 09:40 AM
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.

0
Jack
Telerik team
answered on 30 Nov 2012, 03:09 PM
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.
Tags
GridView
Asked by
Bexm
Top achievements
Rank 1
Answers by
Pawz
Top achievements
Rank 1
Bexm
Top achievements
Rank 1
Jack
Telerik team
Espen
Top achievements
Rank 1
Marius
Top achievements
Rank 1
erwin
Top achievements
Rank 1
Veteran
Iron
Share this question
or