This question is locked. New answers and comments are not allowed.
Ivan Kopcanski
Top achievements
Rank 1
Ivan Kopcanski
asked on 03 Sep 2010, 11:10 AM
Hello,
We use RadGridView with custom sorting.
We handle the sorting event and populate grid with sorted data.
But, after e.Cancel = true the sorting triangle is missing.
It looks like GridViewHeaderCell is in 'None' sorting visual state.
Is it possible to retrieve the collection of header cells in this event,
find the clicked one and move it to 'Ascending' or 'Descending' visual state?
Please, if you have some alternate solution, provide us with one.
We use RadGridView with custom sorting.
We handle the sorting event and populate grid with sorted data.
But, after e.Cancel = true the sorting triangle is missing.
It looks like GridViewHeaderCell is in 'None' sorting visual state.
Is it possible to retrieve the collection of header cells in this event,
find the clicked one and move it to 'Ascending' or 'Descending' visual state?
Please, if you have some alternate solution, provide us with one.
private void gvData_Sorting(object sender, GridViewSortingEventArgs e){ if (this.IsServerSideSorting) { if (!String.IsNullOrEmpty(e.SortPropertyName)) { this.Columns[e.SortPropertyName].SortingState = _prevState; } e.Cancel = true; ChangeSortingColumn((ColumnLayoutBase)e.Column); }}5 Answers, 1 is accepted
0
Hi Ivan Kopcanski,
To manipulate the sorting state in this case - you need to set the:
Hope this helps.
All the best,
Veselin Vasilev
the Telerik team
To manipulate the sorting state in this case - you need to set the:
e.NewSortingState = Telerik.Windows.Controls.SortingState.Ascending;
Hope this helps.
All the best,
Veselin Vasilev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ivan Kopcanski
Top achievements
Rank 1
answered on 03 Sep 2010, 12:16 PM
I've tried your suggestion without success.
When I remove e.Cancel = true, it works, but I can't do that.
We usually have several pages of data. Without this line the sorting is done
for the data on the current page and clicked column.
After that our custom server side sorting is done for the current column
and we present the data from the last page.
So, we want to avoid that default sort of the first page on client side
and keep the same column GUI behavior.
Do you have any idea how to achieve this?
When I remove e.Cancel = true, it works, but I can't do that.
We usually have several pages of data. Without this line the sorting is done
for the data on the current page and clicked column.
After that our custom server side sorting is done for the current column
and we present the data from the last page.
So, we want to avoid that default sort of the first page on client side
and keep the same column GUI behavior.
Do you have any idea how to achieve this?
0
Hi Ivan Kopcanski,
Please try setting the IsCustomSortingEnabled="True" to the GridViewDataColumn.
If it does not help I would suggest to send us a small running project in a new support ticket so we can debug it locally.
Thanks
All the best,
Veselin Vasilev
the Telerik team
Please try setting the IsCustomSortingEnabled="True" to the GridViewDataColumn.
If it does not help I would suggest to send us a small running project in a new support ticket so we can debug it locally.
Thanks
All the best,
Veselin Vasilev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Ivan Kopcanski
Top achievements
Rank 1
answered on 13 Sep 2010, 08:13 AM
Hi,
I used RadGridView.DataLoaded event to additionally set column sort state.
I left e.Cancel = true in RadGridView.Sorting event to prevent client-side sorting.
This solution works fine for me, but for the others reading this post I will try your
suggestion and let you know if I had any success with it.
I used RadGridView.DataLoaded event to additionally set column sort state.
I left e.Cancel = true in RadGridView.Sorting event to prevent client-side sorting.
This solution works fine for me, but for the others reading this post I will try your
suggestion and let you know if I had any success with it.
0
Valdo
Top achievements
Rank 1
answered on 15 Jul 2011, 09:59 AM
The issue still exists in Q2 2011.
Column configuration as follows:
IsSortable = true,
IsFilterable = false,
IsCustomSortingEnabled = true,
SortMemberPath = 1
Sorting routine:
private void OnDataGridSorting(object sender, GridViewSortingEventArgs e)
{
e.Cancel = true;
// Manipulations with data. Note that e.NewSortingState always ASC here, but sorting triangle is missing.
}
Any suggestions?
EDIT:
It seems that line
e.NewSortingState = e.NewSortingState;
did the trick and set internal property to true.
Column configuration as follows:
IsSortable = true,
IsFilterable = false,
IsCustomSortingEnabled = true,
SortMemberPath = 1
Sorting routine:
private void OnDataGridSorting(object sender, GridViewSortingEventArgs e)
{
e.Cancel = true;
// Manipulations with data. Note that e.NewSortingState always ASC here, but sorting triangle is missing.
}
Any suggestions?
EDIT:
It seems that line
e.NewSortingState = e.NewSortingState;
did the trick and set internal property to true.