I have 2 checkboxes and when i check the first one i want to make the other check bot read only attribute = false
thanks in advance
13 Answers, 1 is accepted
I guess you are trying to enable/disable the CheckBox of a GridCheckBoxColumn depending on the another CheckBoxColumn. The CheckBox of a GridCheckBoxColumn is disabled in the normal mode and will be enabled only in the Edit mode. But you can achieve the desired scenario using a GridTemplateColumn with CheckBox in its ItemTemplate. Here is a sample code which I tried on my end.
I did the following code and i did get an error when clicking on the check box. Object Required. I have this grid control inside another grid.
Could you please send your entire aspx page.
I tried the code again and it didn't give me any error but the problem i have now is that it doesn't work in IE8 browser but it works fine in Mozzilla firefox. In IE 8 when i check or uncheck the first check box the other checkbox stays disabled. Do you know if this works on IE8.
Please let me know if still need the aspx code
in the same scenario I have a hidden colum custid, I'm trying to get the value of this colum when i check or uncheck the check box
My code is below.
<telerik:GridBoundColumn DataField="CustID" DataType="System.String"
EmptyDataText="&nbsp;" HeaderText="CustID" ReadOnly="True"
SortExpression="CustID" UniqueName="CustID" Visible="false">
var rowIndex = CheckBox1.parentNode.parentNode.sectionRowIndex;
var masterTable = $find("<%# radgrid.ClientID %>").get_masterTableView();
var firstDataItem = masterTable.get_dataItems();
var keyValues = firstDataItem.getDataKeyValue("CustID");
Please help Thanks
Try out the following code to retrieve the datakeyvalue for that row on which the checkbox was clicked:
You can traverse through all checkboxes that contain CheckBox2 in the ID:
the Telerik team
We do not have tri-state checkboxes outisde RadTreeView but you could implement the desired functionality using GridTemplateColumn. Put your tri-state checkboxes in the ItemTemplate and the HeaderTemplate and wire them in the code-behind. I would not recommend that you trying to use the built-in GridCheckBoxColumn for this custom scenario.
the Telerik team
I see this question asked in 2012: is there some evolution on this question in the current Telerik ASP.NET Grid for that ?
More generaly, I would like to build something that seems obvious but I didn't found any demo related to the following case:
A grid with a Master table and a detail table + be able to choose the entry from the master table that will select all the entries from the nasted detail grid + be able to select only some of the entries from one or more the nasted grids...
Would you have a Demo showing something near to that ? Somthing that shows how it could work and how to navigate through the selected items in the nasted grids.
Thanks a lot
Since we not every possible scenario is covered with a demo sample, we have created a How-To article for this one. Check it out at Check CheckBoxes of DetailTables using the CheckBox from the MasterTable row in hierarchical RadGrid. Even if this article doesn't necessarily resembles the exact scenario, it could give you an idea of how such functionality can be achieved using either client-side or server-side programming.