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

Row selected in edit mode

1 Answer 38 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tina
Top achievements
Rank 1
Tina asked on 21 Feb 2013, 10:26 AM
I have a checkbox in edititemtemplate. How to make the parent row selected on checking the checkbox?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Feb 2013, 10:31 AM
Hi,

Try the following code to achieve your scenario.
C#:
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
        CheckBox chk = (CheckBox)sender;
        GridEditFormItem editItem = (GridEditFormItem)chk.NamingContainer;
        GridDataItem ditem = (GridDataItem)editItem.ParentItem;
        ditem.Selected = true;
}

Thanks,
Shinu
Tags
General Discussions
Asked by
Tina
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or