У меня есть RadComboBox, как показано ниже: -
<telerik:RadComboBox ID="RadComboBox" runat="server" EmptyMessage="Select" DataSourceID="SqlDataSource1" DataTextField="name" DataValueField="id" ShowMoreResultsBox="true" EnableVirtualScrolling="true" HighlightTemplatedItems="true" ItemsPerRequest="10" >
<HeaderTemplate>
<table style="width: 500px">
<tr>
<td style="font-weight: bold; width: 400px">Name</td>
<td style="font-weight: bold; width: 100px">ID</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table style="width: 500px">
<tr>
<td style="width: 400px"><%#DataBinder.Eval(Container.DataItem, "name")%></td>
<td style="width: 100px"><%#DataBinder.Eval(Container.DataItem, "id")%></td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:SqlConnectionString %>" ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM table1 order by name asc" />
Теперь он наполняет мой RadComboBox
.
Теперь я хочу отсортировать элементы в моем RadComboBox в алфавитном порядке, когда я нажимаю <HeaderTemplate> "Name"
, а когда я нажимаю <HeaderTemplate> "ID"
, я хочу сортировать их по номерам.
Теперь, как этого добиться, может ли кто-нибудь дать мне совет или помощь, спасибо!