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

[Solved] ChildrenOfType<GridViewRow>

2 Answers 239 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Hazeest
Top achievements
Rank 1
Hazeest asked on 10 Nov 2009, 07:28 PM
In Q3 2009 Release
IList<GridViewRow> rows = inventory_grid.ChildrenOfType<GridViewRow>();

rows.Cells contains only visible Cells. But in my grid I have an ID column which is set to Invisible. Is it a bug? How can I get all rows with all cells?

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Milan
Telerik team
answered on 11 Nov 2009, 10:49 AM

Hi Hazeest,

When a column is marked is "IsVisible=false" its cells will not be created and they will not appear in the Cells collection. To workaround this you can just eliminate the "IsVisible=false" and set the Width and MaxWidth properties of that column to zero. That way the column will not be visible but its cells will be created.

In general we do not encourage the use of visual elements like GridViewRow. Is it possible to work with the data items instead? The problem with GridViewRow is that our grid uses virtualization and only a handful of rows are available at any time (just the visible ones). 

You could turn off the virtualization by setting the EnableRowVirtualization property to false which will cause all rows to be created but it will also have a negative impact on the performance. Could you please share more information about your scenario? We might be able to suggest an alternative solution which does not require you to work with all rows.

Sincerely yours,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Hazeest
Top achievements
Rank 1
answered on 11 Nov 2009, 11:53 AM
Thank you.
Width=0 with MaxWidth=0 works just fine.
Tags
GridView
Asked by
Hazeest
Top achievements
Rank 1
Answers by
Milan
Telerik team
Hazeest
Top achievements
Rank 1
Share this question
or