I have a specific need to make the GridGroupHeaderItem to be selectable and should be able to handle the selection change too. I appreciate any help with example. Also how to embedd image in the GridGroupHeader?
The GridGroupHeaderItem does not support selection. You need to add a CheckBox control inside the item and use its CheckedChange event on the server to notify the selection has changed. You can also add an Image or any other server control to the GridGroupHeaderItem. Simply use RadGrid's ItemCreated and ItemDataBound events to add one and the same control in both. The reason we do that:
1. We use ItemCreated to create the controls on every postback. ItemCreated is fired for every grid item on every postback, so it is ideal for dynamically creating controls inside.
2. ItemDataBound fires when the data items have been databound. Even though this event does not fire on every postback, the table cells clear their dynamic controls when they databind. Therefore, we need ItemDataBound to recreate these lost dynamic controls when the items bind. Only ItemCreated is not sufficient, because ItemCreated fires before the cells are databound and we lose all dynamic controls created in ItemCreated when the cells bind.
To demonstrate this approach I have attached a small test page. It shows how you can add both a CheckBox control to keep track of the selected group header items as well as a custom image in the same dynamic way.
Kind regards,
Veli
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
Thanks for the sample. It helped me get going with the required funcitonality. I have set the DataCell.Text to empty and added the Linkbutton in place of check box and wired up the on click event (you could set the commandname to handle in the ItemCommand event itself). So now all the group headers are clickable. Please keep me posted if the group header can be selectable in the future.