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

[Solved] Checkbox in grid is not working

2 Answers 174 Views
Grid
This is a migrated thread and some comments may be shown as answers.
B
Top achievements
Rank 1
B asked on 25 Apr 2009, 09:25 AM
hello,
I have taken checkbox in radgrid using item template.
but even i select it , the checked status has not been changed.
I mean checked property is false only even i select it.

aspx page:

  <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="cbSelect">
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="cbSelect" runat="server" />
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
Code behind:

 foreach (GridDataItem item in rgdInvoiceList.Items)
            {
              CheckBox cb = new CheckBox();
                cb = (CheckBox)item.FindControl("cbSelect");
                if (temp == 0)
                {
                  if (cb != null)
                        if (cb.Checked)    // always this is showing false value only.
                        {
                         string str;
                        }
                }
}

2 Answers, 1 is accepted

Sort by
0
B
Top achievements
Rank 1
answered on 25 Apr 2009, 10:41 AM
since i bind the grid even in post back also so it was giving problem.

0
Shinu
Top achievements
Rank 2
answered on 27 Apr 2009, 04:30 AM
Hi,

Here is a help article which explains how to persist CheckBox control state in GridTemplateColumn on rebind. Go through it and see if it is helpful.
Persisting CheckBox control state in GridTemplateColumn on rebind

Shinu
Tags
Grid
Asked by
B
Top achievements
Rank 1
Answers by
B
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or