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

Gridview Hierarchy - parent Groups

1 Answer 138 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 19 Jul 2010, 09:03 AM
Hi,

I'm using Gridview Winforms in C#

I have a Grid view with 2 level hierarchy. I want a Checkbox as the first column for both Parent and Child rows.

When the Parent Checkbox is selected, all the associated child records should be checked as well.

How to achieve this ? Please suggest me at the earliest

Thanks
Mike

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 20 Jul 2010, 06:07 PM
Hi Mike,

You should handle the ValueChanged event and check whether the checkbox editor is the event sender. Please consider the sample below:

void radGridView1_ValueChanged(object sender, EventArgs e)
{
    RadCheckBoxEditor editor = sender as RadCheckBoxEditor;
    if (editor != null && this.radGridView1.CurrentRow.ViewInfo.ParentRow == null)
    {               
        foreach (GridViewRowInfo row in this.radGridView1.CurrentRow.ChildRows)
        {
            row.Cells["Check"].Value = editor.Value;
        }
    }
}

I hope it helps.

Kind regards,
Jack
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
Tags
GridView
Asked by
Mike
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or