I am currently using Rad Multicolumn Combobox.
The problem is when I set its selected index in my .vb (code behind) file
Example: RadComboBox1.SelectedIndex = 2
The textbox ( of combobox) will not get populated with the appropriate value & even if I click on the dropdown the appropriate item will not be highlighted.
Any help regarding this will be appreciated. Thanks in advance.
8 Answers, 1 is accepted
What about finding the item and selecting it at the client-side using the findItemByText() method of the combobox object and the select() method of the combobox item.
Hope this helps.
Kind regards,
Nick
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Thanks for your reply. With the help of your suggession I could able to get selected index property working as expected with normal ComboBox but the same things didnot work for Multicolumn ComboBox.
What I did was
After databinding :
RadComboBox1.SelectedValue = ""
on Button Click event:
RadComboBox1.SelectedIndex = RadComboBox1.FindItemIndexByText("Arial")
below is my multicolumn combobox. Please help me in this regard
<
radC:RadComboBox
ID="RadComboBox1"
runat="server"
skin = "Classic"
Height="100px"
Width="150px"
MarkFirstMatch="true"
EnableLoadOnDemand="true"
HighlightTemplatedItems="true"
DropDownWidth="475px"
ItemRequestTimeout="500"
AllowCustomText ="false" >
<HeaderTemplate >
<table style="width:425px; text-align:left">
<tr>
<td style="width:125px">
Style
</td>
<td style="width:250px">
Sample Text
</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table style="width:425px; text-align:left ">
<tr>
<td style="width:125px">
<%#DataBinder.Eval(Container.DataItem, "FontName")%>
</td>
<td style="width:250px">
<asp:Label ID="lblFont" runat="server"></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</radC:RadComboBox>
The reason for the problem is that the Text of Item is not set. I suggest you set DataTextField property of RadComboBox to "FontName"
For an example:
| < |
| radC:RadComboBox |
| ID="RadComboBox1" |
| runat="server" |
| skin = "Classic" |
| Height="100px" |
| Width="150px" |
| MarkFirstMatch="true" |
| EnableLoadOnDemand="true" |
| HighlightTemplatedItems="true" |
| DropDownWidth="475px" |
| ItemRequestTimeout="500" |
| AllowCustomText ="false" DataTextField="FontName"> |
Regards,
Rosi
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Thanks for your reply, I tried your suggestion but no success. Can you please send me any sample running project in this regard.
Please, find attached a sample project showing how to achieve this. Note that when you use LoadOnDemand(EnableLoadOnDemand="true"), you should set Text instead of SelectedIndex (refer to the LOD.aspx).
In case you are not using LoadOnDemand everything will work as expected (see the NotLOD.aspx).
Hope it will be helpful.
Regards,
Helen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Thank you so much. It worked as expected.
You made my day. !!!!!!!!!!!
venm
Both ways should work.
Regards,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
