5 Answers, 1 is accepted
To achieve your goal you could handle onload client side event of GridGroupHeaderItem and add a checkbox. Please give this suggestion a try and see if it works for you.
Best wishes,
Pavlina
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Could you please send us the code you currently use to achieve the desired functionality? Thus we can test it locally and advise you further.
All the best,
Pavlina
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.
For grid events OnItemCreated (server-side), and ItemDataBound (server-side), I am calling the following method:
private void CreateHeaderControls(GridItemEventArgs e)
{
if (e.Item is GridGroupHeaderItem)
{
GridGroupHeaderItem item = e.Item as GridGroupHeaderItem;
DataRowView groupDataRow = (DataRowView)e.Item.DataItem;
CheckBox check = new CheckBox();
check.AutoPostBack =
true;
check.ID =
"CheckAll";
check.Text =
"Select all items in group ";
check.CheckedChanged +=
new EventHandler(check_CheckedChanged);
check.Visible =
true;
check.ToolTip =
"Select all in this group ";
item.DataCell.Controls.Add(check);
item.DataCell.Visible =
true;
}
}
The problem seems to be that my grid settings in the Mark-up contain: grouploadmode="Client"
I need this to stay client because I am using some other javascript to expand/collapse the groups in the grid, which works perfectly fine. If I change GroupLoadMode="Server", the server-side code listed above generates the checkboxes, but only after the first rebind.
What I would like to accomplish, is the same functionality listed above in the CreateHeaderControls method but using some client-side scripting. Is there any example that would show me how to accomplish this?
Thanks!
You can use RadGrid client-side API to accomplish this
Getting RadGrid client object and related topics.
Kind regards,
Pavlina
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.