Hi guys,
I have an issue in distinct loading values sorting method, The radgrid default sort order was none at the time itself the filter distinct values are sort by asc as default.
I have done if the grid was desc then the distinct values are sort by desc as well as to Asc, but am facing an issue in the radgrid default sort order was none at the time the distinct values are sort by asc by default it should be sort by none. please help me in this issue, the code I used for sorting is
Private Sub grdMessages_DistinctValuesLoading(ByVal sender As Object, e As Telerik.Windows.Controls.GridView.GridViewDistinctValuesLoadingEventArgs) Handles grdMessages.DistinctValuesLoading
Dim gridView = TryCast(sender, RadGridView)
If e.Column.SortingState = SortingState.Descending Then
e.ItemsSource = gridView.GetDistinctValues(e.Column, True).OfType(Of String)().OrderByDescending(Function(x) x)
ElseIf e.Column.SortingState = SortingState.Ascending Then
e.ItemsSource = gridView.GetDistinctValues(e.Column, True).OfType(Of String)().OrderBy(Function(x) x)
ElseIf e.Column.SortingState = SortingState.None Then
e.ItemsSource = ? 'confused in this part
End If
End Sub
I have an issue in distinct loading values sorting method, The radgrid default sort order was none at the time itself the filter distinct values are sort by asc as default.
I have done if the grid was desc then the distinct values are sort by desc as well as to Asc, but am facing an issue in the radgrid default sort order was none at the time the distinct values are sort by asc by default it should be sort by none. please help me in this issue, the code I used for sorting is
Private Sub grdMessages_DistinctValuesLoading(ByVal sender As Object, e As Telerik.Windows.Controls.GridView.GridViewDistinctValuesLoadingEventArgs) Handles grdMessages.DistinctValuesLoading
Dim gridView = TryCast(sender, RadGridView)
If e.Column.SortingState = SortingState.Descending Then
e.ItemsSource = gridView.GetDistinctValues(e.Column, True).OfType(Of String)().OrderByDescending(Function(x) x)
ElseIf e.Column.SortingState = SortingState.Ascending Then
e.ItemsSource = gridView.GetDistinctValues(e.Column, True).OfType(Of String)().OrderBy(Function(x) x)
ElseIf e.Column.SortingState = SortingState.None Then
e.ItemsSource = ? 'confused in this part
End If
End Sub