Hi Nitin,
Thanks for your interest in syncfusion products.
If your intention is to highlight the selected item in the items added to the GenericDropDownControl then it can be achieved by enabling the selected property of the corresponding item. Here we have created a simple sample for adding TreeView in GenericDropDown control and by default the items with value 7 will be selected then during run time the item will be highlighted based on the items selected. Please find the below code snippet to achieve this,
[VB]
Protected Sub tree_NodeSelected(ByVal sender As Object, ByVal e As Syncfusion.Web.UI.WebControls.Tools.TreeViewNodeSelectEventArgs)
GenericDropDown1.Text = TreeView1.SelectedNode.Text //displays the selected item text in GenericDropDown1
End Sub
Protected Sub TreeView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles TreeView1.DataBound
findValue(TreeView1.Items)
End Sub
Protected Sub findValue(ByVal items As TreeViewItemCollection)
For Each item As TreeViewNode In items
If (item.Value.Equals("7")) Then
item.Selected = True //highlight the item which has the value “7”
GenericDropDown1.Text = item.Text
End If
If (item.HasSubNodes) Then
findValue(item.Items)//this continues recursively to highlight the items
End If
Next
End Sub
Kindly download the sample from the following link,
generic-760246203.zipPlease try the sample and let us know if this helps.
Regards,
Varalakshmi R.S