Row selected in edit mode

2 posts, 0 answers
  1. Tina
    Tina avatar
    130 posts
    Member since:
    Jul 2011

    Posted 21 Feb 2013 Link to this post

    I have a checkbox in edititemtemplate. How to make the parent row selected on checking the checkbox?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Feb 2013 Link to this post

    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
Back to Top