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

Access GridGroupHeaderItem client-side (javascript)

2 Answers 137 Views
Grid
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 26 Oct 2012, 03:35 PM
Is it possible to access the GridGroupHeaderItems client-side? Assuming I have something like this in my grid:
<GroupHeaderTemplate>
    <asp:CheckBox runat="server" ID="cbGroupHeader"/>
</GroupHeaderTemplate>

I can do something like this server-side:
foreach(GridGroupHeaderItem item in RadGrid1.MasterTableView.GetItems(GridItemType.GroupHeader))
{
    var cb = (CheckBox)(item.FindControl("cbGroupHeader"));
    cb.Checked = true;
}

Can I do something like this client-side (i.e., with JavaScript)? All I can seem to get is the data items.

Thanks,

J

2 Answers, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 31 Oct 2012, 09:41 AM
Hello,

Please try the following approach:
function getCheckBoxes() {
    var gridElement = $find("<%= RadGrid1.ClientID %>").get_element();
    var checkBoxes = $telerik.$(gridElement).find("[id$='_cbGroupHeader']");
}

I hope this will prove helpful. Please give it a try and let me know about the result.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
J
Top achievements
Rank 1
answered on 15 Nov 2012, 02:25 PM
Thanks Eyup! It's perfect! I would have never come up with that. Sorry for the late response!
Tags
Grid
Asked by
J
Top achievements
Rank 1
Answers by
Eyup
Telerik team
J
Top achievements
Rank 1
Share this question
or