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

Check CheckBox GridHeardItem when checkbox GridDataItem is checked or unchecked

1 Answer 76 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andrew
Top achievements
Rank 1
Andrew asked on 21 Dec 2015, 04:22 PM

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;
                        break;
                    }
                }
               
            GridHeaderItem headerItem = rgvFunctions.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem;
            (headerItem.FindControl("CheckAll") as CheckBox).Checked = checkHeader;


            
        }

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 24 Dec 2015, 09:20 AM
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.

Regards,
Dimitrina
Telerik
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
Tags
General Discussions
Asked by
Andrew
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or