I have a RadTreeView which has parent nodes which can be expanded to show its child nodes. These child nodes should then be able to be selected using checkboxes, but the parent nodes shouldn't. My issue is an accessibility one, as I wish to have the checkboxes associated with their text through a label, but the RadTreeView uses a <span> tag. The child nodes are populated when the parent node is expanded via the RadTreeView1_NodeExpand() method.
I believe the issue revolves around the parent/child situation as when creating a RadTreeView previously with no child nodes and a DataBind() I was able to declare a <NodeTemplate> which used checkboxes/labels, however this template does not seem to be used when adding the nodes via code behind using the Add() method with parents and children.
Is there a way I can add child nodes that adhere to a template I specify?
Here is my code, I have attached screenshots as well showing the association errors via WAVE.
No parent/children aspx:
<telerik:RadTreeView ID="RadTreeView1" runat="server" Skin="Skin_Telerik"
CheckBoxes="false" MultipleSelect="true" SingleExpandPath="False"
DataTextField="IDWithTitle" EnableEmbeddedSkins="false" DataFieldID="CategoryID"
DataValueField="CategoryID" OnClientNodeClicked="ClientNodeClicked" Style="font-size:medium; white-space: normal;">
<NodeTemplate>
<asp:CheckBox runat="server" id="chkCategory" CssClass="rtChk"
Text='<%# String.Format("{0}: {1}", DataBinder.Eval(Container.DataItem, "CategoryID"), DataBinder.Eval(Container.DataItem, "Title")) %>' />
<asp:HiddenField runat="server" ID="categoryID" Value='<%#DataBinder.Eval(Container.DataItem, "CategoryID")%>' />
</NodeTemplate>
</telerik:RadTreeView>
No parent/children VB:
RadTreeView1.DataSource = oList
RadTreeView1.DataBind()
Parent/children aspx:
<telerik:radtreeview id="RadTreeView1" AccessKey="M" TabIndex="1" runat="server" skin="Skin_Telerik" checkboxes="true"
multipleselect="true" singleexpandpath="False" datatextfield="Title" da enableembeddedskins="false"
datafieldid="ID" datafieldparentid="ParentId" datavaluefield="ID" onclientnodeclicked="ClientNodeClicked"
onnodeexpand="RadTreeView1_NodeExpand" Style="white-space: normal;" CheckChildNodes="true" Font-Size="Medium"/>
Parent/children VB:
Any help would be much appreciated!
Alan
I believe the issue revolves around the parent/child situation as when creating a RadTreeView previously with no child nodes and a DataBind() I was able to declare a <NodeTemplate> which used checkboxes/labels, however this template does not seem to be used when adding the nodes via code behind using the Add() method with parents and children.
Is there a way I can add child nodes that adhere to a template I specify?
Here is my code, I have attached screenshots as well showing the association errors via WAVE.
No parent/children aspx:
<telerik:RadTreeView ID="RadTreeView1" runat="server" Skin="Skin_Telerik"
CheckBoxes="false" MultipleSelect="true" SingleExpandPath="False"
DataTextField="IDWithTitle" EnableEmbeddedSkins="false" DataFieldID="CategoryID"
DataValueField="CategoryID" OnClientNodeClicked="ClientNodeClicked" Style="font-size:medium; white-space: normal;">
<NodeTemplate>
<asp:CheckBox runat="server" id="chkCategory" CssClass="rtChk"
Text='<%# String.Format("{0}: {1}", DataBinder.Eval(Container.DataItem, "CategoryID"), DataBinder.Eval(Container.DataItem, "Title")) %>' />
<asp:HiddenField runat="server" ID="categoryID" Value='<%#DataBinder.Eval(Container.DataItem, "CategoryID")%>' />
</NodeTemplate>
</telerik:RadTreeView>
No parent/children VB:
RadTreeView1.DataSource = oList
RadTreeView1.DataBind()
Parent/children aspx:
<telerik:radtreeview id="RadTreeView1" AccessKey="M" TabIndex="1" runat="server" skin="Skin_Telerik" checkboxes="true"
multipleselect="true" singleexpandpath="False" datatextfield="Title" da enableembeddedskins="false"
datafieldid="ID" datafieldparentid="ParentId" datavaluefield="ID" onclientnodeclicked="ClientNodeClicked"
onnodeexpand="RadTreeView1_NodeExpand" Style="white-space: normal;" CheckChildNodes="true" Font-Size="Medium"/>
Parent/children VB:
Any help would be much appreciated!
Alan