Hi,
I am using custom sorting.
I've tried to follow some suggestions in other thread regarding the use of Loaded event to set the initial sorting state for my columns.
void GenWiseRadGrid_Loaded(object sender, RoutedEventArgs e)
{
if (ItemsControl != null)
{
Sorting += GenWiseRadGrid_Sorting;
if (DataContext != null)
ApplySortToGrid(BaseProvider.DefaultSort);
}
}
private void ApplySortToGrid(ISort pSort)
{
if (pSort == null) throw new ArgumentNullException("pSort");
var name = BaseProvider.DefaultSort.DataProperty.PropertyName;
var column = Columns[name];
column.SortingState = BaseProvider.DefaultSort.Order.IsAscending ? SortingState.Ascending : SortingState.Descending;
column.HeaderText = "test";
the ApplySortToGrid gets called, but the control does not repaint/refresh.
I've tried :
InvalidateVisual();
InvalidateArrange();
UpdateLayout();
Nothing seems to get the control to repaint/ refresh...
We are not using SortDescriptions
if (SortDescriptions.Count > 0) throw new Exception("WE SHOULD NOT USE SORT DESCRIPTORS");
<telerik:GridViewDataColumn HeaderText="Category Name" UniqueName="Category_name"
IsCustomSortingEnabled="True"
DataMemberBinding="{Binding Category.Category_name}" >
</telerik:GridViewDataColumn>
Also I've noticed that the data is STILL sorted internally (so i return a list in a certain order but the grid will show it desc). I am doing the DESC already internally in my SQL engine .
Any idea???
I am using custom sorting.
I've tried to follow some suggestions in other thread regarding the use of Loaded event to set the initial sorting state for my columns.
void GenWiseRadGrid_Loaded(object sender, RoutedEventArgs e)
{
if (ItemsControl != null)
{
Sorting += GenWiseRadGrid_Sorting;
if (DataContext != null)
ApplySortToGrid(BaseProvider.DefaultSort);
}
}
private void ApplySortToGrid(ISort pSort)
{
if (pSort == null) throw new ArgumentNullException("pSort");
var name = BaseProvider.DefaultSort.DataProperty.PropertyName;
var column = Columns[name];
column.SortingState = BaseProvider.DefaultSort.Order.IsAscending ? SortingState.Ascending : SortingState.Descending;
column.HeaderText = "test";
the ApplySortToGrid gets called, but the control does not repaint/refresh.
I've tried :
InvalidateVisual();
InvalidateArrange();
UpdateLayout();
Nothing seems to get the control to repaint/ refresh...
We are not using SortDescriptions
if (SortDescriptions.Count > 0) throw new Exception("WE SHOULD NOT USE SORT DESCRIPTORS");
<telerik:GridViewDataColumn HeaderText="Category Name" UniqueName="Category_name"
IsCustomSortingEnabled="True"
DataMemberBinding="{Binding Category.Category_name}" >
</telerik:GridViewDataColumn>
Also I've noticed that the data is STILL sorted internally (so i return a list in a certain order but the grid will show it desc). I am doing the DESC already internally in my SQL engine .
Any idea???