Hi,
I am trying to bind my RadTreeView control but for some reason the (+) sign is not coming with parent node to expand it and bind child nodes on server side.
Any help would be really appreciated.
Thanks
<telerik:RadTreeView runat="Server" ID="rtvUserProducts" Height="300" Width="300"
Skin="Vista">
<Nodes>
<telerik:RadTreeNode Expanded="true" Text="Parent" ExpandMode="ServerSide" runat="server">
<NodeTemplate>
<asp:Label ID="lblProductName" Text='<%# Bind("ProductCodeAndDesc") %>' runat="server">
</asp:Label>
<asp:HiddenField ID="hidLogisticProductKey" Value='<%# Bind("LogisticProductKey") %>'
runat="server" />
</NodeTemplate>
<Nodes>
<telerik:RadTreeNode Expanded="true" Text="Child" ExpandMode="ServerSide">
<NodeTemplate>
<asp:Label ID="lblUserName" Text='<%# Bind("UserName") %>' runat="server"></asp:Label>
</NodeTemplate>
</telerik:RadTreeNode>
</Nodes>
</telerik:RadTreeNode>
</Nodes>
</telerik:RadTreeView>
Protected Sub LoadProductsInTreeView()
Dim oDataTable As New DataTable
Dim oConn As New SqlConnection(SprintDB.GetStockSystemConnectionString)
Dim sSQL As String
Dim sb As New StringBuilder
sb.Append("select distinct lp.LogisticProductKey, ProductDescription + ' (' + ProductCode + ')' 'ProductCodeAndDesc' from stockAlertRecipients sar inner join LogisticProduct lp on lp.LogisticProductKey = sar.Filter")
sSQL = sb.ToString
Dim oAdapter As New SqlDataAdapter(sSQL, oConn)
Try
oAdapter.Fill(oDataTable)
rtvUserProducts.DataTextField = "ProductCodeAndDesc"
rtvUserProducts.DataValueField = "LogisticProductKey"
rtvUserProducts.DataFieldParentID = "LogisticProductKey"
rtvUserProducts.DataSource = oDataTable
rtvUserProducts.DataBind()
rtvUserProducts.ExpandAllNodes()
Catch ex As Exception
WebMsgBox.Show(ex.Message.ToString)
End Try
End Sub
I am trying to bind my RadTreeView control but for some reason the (+) sign is not coming with parent node to expand it and bind child nodes on server side.
Any help would be really appreciated.
Thanks
Skin="Vista">
<Nodes>
<telerik:RadTreeNode Expanded="true" Text="Parent" ExpandMode="ServerSide" runat="server">
<NodeTemplate>
<asp:Label ID="lblProductName" Text='<%# Bind("ProductCodeAndDesc") %>' runat="server">
</asp:Label>
<asp:HiddenField ID="hidLogisticProductKey" Value='<%# Bind("LogisticProductKey") %>'
runat="server" />
</NodeTemplate>
<Nodes>
<telerik:RadTreeNode Expanded="true" Text="Child" ExpandMode="ServerSide">
<NodeTemplate>
<asp:Label ID="lblUserName" Text='<%# Bind("UserName") %>' runat="server"></asp:Label>
</NodeTemplate>
</telerik:RadTreeNode>
</Nodes>
</telerik:RadTreeNode>
</Nodes>
</telerik:RadTreeView>
Dim oDataTable As New DataTable
Dim oConn As New SqlConnection(SprintDB.GetStockSystemConnectionString)
Dim sSQL As String
Dim sb As New StringBuilder
sb.Append("select distinct lp.LogisticProductKey, ProductDescription + ' (' + ProductCode + ')' 'ProductCodeAndDesc' from stockAlertRecipients sar inner join LogisticProduct lp on lp.LogisticProductKey = sar.Filter")
sSQL = sb.ToString
Dim oAdapter As New SqlDataAdapter(sSQL, oConn)
Try
oAdapter.Fill(oDataTable)
rtvUserProducts.DataTextField = "ProductCodeAndDesc"
rtvUserProducts.DataValueField = "LogisticProductKey"
rtvUserProducts.DataFieldParentID = "LogisticProductKey"
rtvUserProducts.DataSource = oDataTable
rtvUserProducts.DataBind()
rtvUserProducts.ExpandAllNodes()
Catch ex As Exception
WebMsgBox.Show(ex.Message.ToString)
End Try
End Sub