I have got radgrid which consists of 2 columns, 1 Test checkbox and other is amount. What I would like to do is this when user tick testcheck box I want amount column to be editable.
can you please tell me how to get round of this problem.
telerik:RadGrid ID="TestGrid" runat="server" AutoGenerateColumns="False" GridLines="None" ShowHeader="False">
<ItemStyle Width="20px" />
<asp:CheckBox ID="TestCheckBox" runat="server" AutoPostBack="true" />
<telerik:GridBoundColumn HeaderText="Amount" DataField="Amount" UniqueName="Amount" />
5 Answers, 1 is accepted
You can achieve this by attaching 'OnCheckedChanged' event to CheckBox in ItemTemplate. In that event handler access the GridItem and put it in edit mode.
In order to show the Update/Cancel button for edit row, you need to add a Edit column in to the Column collection property of GridTableView. Then in PreRender event you can hide edit button for all the grid items except the item in edit mode.
In PreRender event you can reset the Checked property of CheckBox like below.
Your help has been really great!
I'm displaying TestGrid data on TestPage.aspx. I have Save button on this page.
When user tick on grid row(s) amount gridboundcolumn in datagrid becomes editable so can user add amount in that textbox.
I'm saving that row data in database.
What I need to do now is this when user load test.aspx page i want to load data from the database and tick row(s) and make amount gridboundcolumn editable which has been selected previously.
You can assign the value from database to the CheckBox by using data binding expression on the Checked property of CheckBox.
And in PreRender event loops through each item and make it editable if the CheckBox for corresponding row is selected.
Note: You should set AllowMultiRowEdit="true" to enable multi-row editing