Hello,
I have a RadComboBox with a single RadTreeView as the template item. I essentially want to allow the user to pick an option from the Tree in the drop down, trigger a postback on the tree nodeclick to save and act on the selection, then set the text of the combo box to the item that was selected in the Tree. The only way I've been able to achieve this thus far is by setting the AllowCustomText attribute to "true" on the RadCombo box. If I don't set this to true, the RadCombo box does not display the value that I have set from the selected tree node during the postback. When I set AllowCustomText to "true" however, this allows the user to type text into the RadComboBox field, which is not acceptable. I need to restrict the value of the RadComboBox to the items displayed in the contained tree. Preferably, the user cannot type into the RadComboBox at all. Clicking on this field should just open the drop down so the user can select an item from the tree.
Markup:
C# Code Behind:
I'm open to any suggestions to achieve this behavior. Thanks!
I have a RadComboBox with a single RadTreeView as the template item. I essentially want to allow the user to pick an option from the Tree in the drop down, trigger a postback on the tree nodeclick to save and act on the selection, then set the text of the combo box to the item that was selected in the Tree. The only way I've been able to achieve this thus far is by setting the AllowCustomText attribute to "true" on the RadCombo box. If I don't set this to true, the RadCombo box does not display the value that I have set from the selected tree node during the postback. When I set AllowCustomText to "true" however, this allows the user to type text into the RadComboBox field, which is not acceptable. I need to restrict the value of the RadComboBox to the items displayed in the contained tree. Preferably, the user cannot type into the RadComboBox at all. Clicking on this field should just open the drop down so the user can select an item from the tree.
Markup:
<
telerik:RadComboBox
ID
=
"RadComboObjectPicker"
runat
=
"server"
Skin
=
"Office2010Blue"
Width
=
"150px"
Height
=
"300px"
AccessibilityMode
=
"True"
EnableTextSelection
=
"False"
AllowCustomText
=
"true"
DropDownWidth
=
"250px"
>
<
Items
>
<
telerik:RadComboBoxItem
runat
=
"server"
TabIndex
=
"1"
/>
</
Items
>
<
ItemTemplate
>
<
telerik:RadTreeView
ID
=
"RadTreeObjectPicker"
runat
=
"server"
Skin
=
"Office2010Blue"
OnNodeClick
=
"RadTreeObjectPicker_NodeClick"
TabIndex
=
"1"
>
</
telerik:RadTreeView
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
C# Code Behind:
protected
void
RadTreeObjectPicker_NodeClick(
object
sender, RadTreeNodeEventArgs e)
{
//if (!String.IsNullOrEmpty(e.Node.Value))
//{
// TakeSomeAction(e.Node.Value);
//}
RadComboObjectPicker.Text = e.Node.Text;
}
I'm open to any suggestions to achieve this behavior. Thanks!