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

one event for header selection

1 Answer 18 Views
GridView
This is a migrated thread and some comments may be shown as answers.
liat even
Top achievements
Rank 1
liat even asked on 28 Jun 2010, 10:40 AM
Hi,

I have a GridView with a SelectColumn (checkboxes). I need to load all the grid in advanced, because the checkbox state controls if the item will be presented or not.
I added an event handler for row loaded which adds an event handler for each row for handling the checked status change.
The problem is when selecting\unselecting the header checkbox. it functions correctly but is very time consuming as it actually loops over all the rows in the grid and handles each row's painting separately.
what i would like to do is to get one event (something like header selected), which will get the information of the items from the data source and will handle the painting once for all rows.
Is that possible? I couldn't find a way for doing it...

thanks!

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 28 Jun 2010, 12:19 PM
Hi liat even,

It seems to me that the conditional loading logic should be handled on the data level instead on the UI layer.  For example, you can create a filter which will filter out all items that are not checked. For this scenario to work you will need to have a Checked property on the data items. If this is not desirable or impossible you can wrap the original data items in a ViewModel  which will expose the Checked property.  

Best wishes,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
liat even
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or