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

Checkbox

3 Answers 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Arun
Top achievements
Rank 1
Arun asked on 05 Feb 2013, 09:08 PM
Hi

Am new to telerik,  Can someone help to solve the below scenario?

 I have radgrid, in that each row contains the check box and by selecting the checkbox, want to edit the certain column in that row.

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 06 Feb 2013, 03:53 AM
Hi,

Please take a look into the following code snippet to edit row on CheckBox click.

ASPX:
<telerik:GridTemplateColumn>
    <ItemTemplate>
        <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true" OnCheckedChanged="CheckBox1_CheckedChanged" />
    </ItemTemplate>
</telerik:GridTemplateColumn>

C#:
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
    CheckBox CheckBox1 = (CheckBox)sender;
    GridDataItem Ditem = (GridDataItem)CheckBox1.NamingContainer;
    Ditem.Edit = true;
}

Thanks,
Shinu.
0
Arun
Top achievements
Rank 1
answered on 06 Feb 2013, 02:10 PM
hi shinu

Thanks for answering. 

But while postbacking , tick mark in checkbox is gone. 
I used pre-render function too, but no success 
0
Shinu
Top achievements
Rank 2
answered on 07 Feb 2013, 08:03 AM
Hi,

Please check this help documentation to persist the CheckBox state.

Thanks,
Shinu.
Tags
Grid
Asked by
Arun
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Arun
Top achievements
Rank 1
Share this question
or