I'm using the RadComboBox control to do sorting on a grid I'm using.
The RadComboBox I'm using is set like so:
The problem I'm experiencing is setting the selected sort order when the page loads, since I pass in the url.
What I mean, is that I can't write this:
When I write that nothing gets selected, it still remains with the first item selected.
Is it not possible to select a specific item of the RadComboBox in MVC through code or should I be doing it another way. I've tried using javascript, but I handle the "OnClientSelectedIndexChanged" event of the control and when I select the item in javascript that event is raised causing the page to postback.
If you could suggest a solution to a problem that would be great.
Thanks.
The RadComboBox I'm using is set like so:
<telerik:RadComboBox ID="ddlSortBy" runat="server" OnClientSelectedIndexChanged="OrderSearch" |
CssClass="ddlSortBy" OnClientLoad="SortByLoad"> |
<Items> |
<telerik:RadComboBoxItem Text="Displayed Randomly" Value="1" /> |
<telerik:RadComboBoxItem Text="By Nightly Rate Ascending" Value="2" /> |
<telerik:RadComboBoxItem Text="By Nightly Rate Descending" Value="3" /> |
<telerik:RadComboBoxItem Text="By Weekly Rate Ascending" Value="4" /> |
<telerik:RadComboBoxItem Text="By Weekly Rate Descending" Value="5" /> |
</Items> |
</telerik:RadComboBox> |
What I mean, is that I can't write this:
ddlSortBy.FindItemByValue("[query]").Selected = true; |
Is it not possible to select a specific item of the RadComboBox in MVC through code or should I be doing it another way. I've tried using javascript, but I handle the "OnClientSelectedIndexChanged" event of the control and when I select the item in javascript that event is raised causing the page to postback.
If you could suggest a solution to a problem that would be great.
Thanks.