Hello,
I have two radgrid in which one contains two fields a check box and a name. The system checks what the user has access to and selects the appropiate check box if the user has rights to those feeds. Since there are a lot of feeds I would like the "Selected" checkbox items to appear first. I am unsure on how to do this. Here is my Rad Grid
I have two radgrid in which one contains two fields a check box and a name. The system checks what the user has access to and selects the appropiate check box if the user has rights to those feeds. Since there are a lot of feeds I would like the "Selected" checkbox items to appear first. I am unsure on how to do this. Here is my Rad Grid
<telerik:RadGrid ID="RadFeedsList" |
DataSourceID="SqlDataSource2" |
AllowMultiRowSelection="True" |
runat="server" |
AllowSorting="True" |
GridLines="None" |
Width="300px" |
CssClass="FeedsList" |
AutoGenerateColumns="False" |
Skin=""> |
<MasterTableView Width="100%"> |
<RowIndicatorColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</RowIndicatorColumn> |
<ExpandCollapseColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</ExpandCollapseColumn> |
<Columns> |
<telerik:GridClientSelectColumn SortExpression="CategoryID" UniqueName="ClientSelectColumn" ItemStyle-Width="10px" /> |
<telerik:GridBoundColumn DataField="CategoryID" UniqueName="id" Visible="false" HeaderText="Feeds"></telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="Name" UniqueName="Name" HeaderText="Feeds"></telerik:GridBoundColumn> |
</Columns> |
</MasterTableView> |
<ClientSettings> |
<Selecting EnableDragToSelectRows="true" AllowRowSelect="True"></Selecting> |
</ClientSettings> |
<SelectedItemStyle CssClass="SelectedItem"></SelectedItemStyle> |
<AlternatingItemStyle CssClass="" ></AlternatingItemStyle> |
</telerik:RadGrid> |
And here is the code that I am trying to get to work:
GridSortExpression expression = new GridSortExpression(); |
expression.FieldName = "CategoryID"; |
expression.SetSortOrder("Ascending"); |
RadFeedsList.MasterTableView.SortExpressions.AddSortExpression(expression); |
RadFeedsList.MasterTableView.Rebind(); |
But it clears all the checkboxes on the rebind/