Check CheckBox GridHeardItem when checkbox GridDataItem is checked or unchecked

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    3 posts
    Member since:
    Dec 2015

    Posted 21 Dec 2015 Link to this post

    How do i find the GroupHeader checkbox from the subgroup checkbox. Here is my code, it toggles between data item checkbox checked or unchecked. The problem I having is that I have a grouping of checkbox. This code is selecting the header level and not the group level of the checkbox. How can I select a check box item that will update the group checkbox?


     protected void ToggleRowSelection(object sender, EventArgs e)
                ((sender as CheckBox).NamingContainer as GridItem).Selected = (sender as CheckBox).Checked;
                bool checkHeader = true;
                    foreach (GridDataItem dataItem in rgvFunctions.MasterTableView.Items)
                        if (!(dataItem.FindControl("isFunction") as CheckBox).Checked)
                            checkHeader = false;
                GridHeaderItem headerItem = rgvFunctions.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem;
                (headerItem.FindControl("CheckAll") as CheckBox).Checked = checkHeader;


  2. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 24 Dec 2015 Link to this post

    Hello Andrew,

    Looking at the shared code line, it seems your question is not related to Telerik Platform and generally I would suggest you to post it under the respective forum category. In this case, you already opened another request under UI for ASP.NET AJAX forum and it is already answered. For anyone interested in the answer, it can be found here.

    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 Feedback Portal and vote to affect the priority of the items
Back to Top