Due to having to disable a checkbox but still have it visible on the client side (using client side javascript to check and uncheck it as items in a grid underneath of it are checked) I have added an asp:CheckBox to a node on the server side with the following code:
RadTreeNode substanceNode = new RadTreeNode(substanceRow["Substance_Name"].ToString(), substanceRow["SUBSTANCE_ID"].ToString());
substanceNode.ExpandedImageUrl =
"~/Images/FolderOpen.gif";
substanceNode.ImageUrl =
"~/Images/FolderClosed.gif";
CheckBox indicator = new CheckBox();
indicator.Enabled =
false;
indicator.Visible =
true;
indicator.ID =
"chkSource";
substanceNode.Controls.Add(indicator);
How can I access this checkbox on the client side to work with it. Here is my client side code where I need to work with this checkbox
for (var i=0; i < nodes.length; i++)
{
if (nodes[i].get_value() == selectedSubstanceId)
{
checkbox = nodes[i].findControl(
"chkSource");
}
}
the rest of the logic is working fine I just can't get the checkbox to work with it.
the findControl returns null.
Any help to figure this out is greatly appreciated.
Thanks
John
protected void radGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == "RowClick" && e.Item is GridDataItem)
{
foreach (GridColumn column in radGrid1.MasterTableView.Columns)
{
string IDx = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][column.UniqueName].ToString();
column.CurrentFilterValue = IDx;
}
}
}

| <head runat="server"> |
| <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| <script type="text/javascript"> |
| <!-- |
| function OnRowDblClick(sender, eventArgs) { |
| var dataItem = $get(eventArgs.get_id()); |
| var grid = sender; |
| var MasterTable = grid.get_masterTableView(); |
| var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()]; |
| var cell = MasterTable.getCellByColumnUniqueName(row, "CurrRegionName"); |
| alert(cell.innerHTML); |
| var tabStrip = $find("<%= TabStrip1.ClientID %>"); |
| var selectedTab = tabStrip.findTabByText(cell.innerHTML); |
| tabStrip.commitChanges(); |
| } |
| --> |
| </script> |
| </telerik:RadCodeBlock> |
| <title></title> |
| Server Error in '/' Application. |
| -------------------------------------------------------------------------------- |
| Compilation Error |
| Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. |
| Compiler Error Message: CS0103: The name 'TabStrip1' does not exist in the current context |
| Source Error: |
| Line 15: var cell = MasterTable.getCellByColumnUniqueName(row, "CurrRegionName"); |
| Line 16: alert(cell.innerHTML); |
| Line 17: var tabStrip = $find("<%= TabStrip1.ClientID %>"); |
| Line 18: var selectedTab = tabStrip.findTabByText(cell.innerHTML); |
| Line 19: tabStrip.commitChanges(); |
| Source File: c:\AIK\Projects\Web\I2Care\AssetMgmt\ShowTabs.aspx Line: 17 |
| [SerializationException: Type 'Telerik.Web.UI.GridException' ... is not marked as serializable.] |
| There was a problem extracting DataKeyValues from the DataSource. ... |
<telerik:RadTextBox ID="txtTitle" runat="server" Width="300px" ValidationGroup="vgNewAssign" Skin="Office2007" MaxLength="50">
</telerik:RadTextBox>
<asp:RequiredFieldValidator ID="rfvTitle" runat="server" ErrorMessage="Title is required!" Display="None" ControlToValidate="txtTitle" ValidationGroup="vgNewAssign"></asp:RequiredFieldValidator>
<telerik:RadToolTip ID="ttTitle" Position="MiddleRight" RelativeTo="Element" Skin="Office2007" runat="server" TargetControlID="txtTitle" Text="A brief title for the assignment (required). Limited to 50 characters." Width="300px" AutoCloseDelay="30000" />