This question is locked. New answers and comments are not allowed.
Hi,
I've produced a GridView which shows Student results over a few years. The issue I have is some years, the students may not have taken in the test, therefore a column will end up with no values. (See Screenshot).
I'm wondering if it's possible to detect and hide these empty columns?
Regards,
Drew
I've produced a GridView which shows Student results over a few years. The issue I have is some years, the students may not have taken in the test, therefore a column will end up with no values. (See Screenshot).
I'm wondering if it's possible to detect and hide these empty columns?
Regards,
Drew
4 Answers, 1 is accepted
0
Hi Drew,
Maya
the Telerik team
You may run through the Items collection of the grid and check if all of them have empty value for a particular property. Once you find this out, you may set the corresponding columns' IsVisible property to "False".
Maya
the Telerik team
See What's New in RadControls for Silverlight in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
0
Drew
Top achievements
Rank 1
answered on 18 Nov 2010, 12:53 AM
Thanks, that was the idea I had. However I'm currently unsure of how to do this as there is no GridView.Rows property.
Obviously I need to loop through each column and check if any row has a value.
ie.
For Each Col in GridView.Columns
' Check if Any Row Has a Value
Next
How can I now loop through each row within a column? There is no Column.Row(i) Property etc.
Thanks,
Drew
Obviously I need to loop through each column and check if any row has a value.
ie.
For Each Col in GridView.Columns
' Check if Any Row Has a Value
Next
How can I now loop through each row within a column? There is no Column.Row(i) Property etc.
Thanks,
Drew
0
Hello Drew,
All the best,
Maya
the Telerik team
You may use the Items collection of the RadGridView. For example, if your Business Object is Club and it has a property - Name, you can check if all the names of the items are null as follows:
foreach(Club club in this.clubsGrid.Items){ if(club.Name == null) { }} All the best,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Drew
Top achievements
Rank 1
answered on 18 Nov 2010, 10:12 PM
Thankyou Maya. I must have missed the Items collection!
Regards,
Drew
Regards,
Drew