Hi Team,
On my last posts it takes many days to get a reply. Please give a solution in this as soon as possible.
I had asked it previously, but till now there was no reply on it.
The thing is that by default the sorting is occuring as defined:
- On first click of the column header the sort will happen in ascending order.
and in second click in descending order and so and so.
But my scenario is that I want
- on first click have to sort in ascending, on second click revert back to previous condition (None as unsorted form of data - in columns as on first load) and on third click descending sort. Then on fourth unsorted and on next ascending and so and so.
So please do reply on this as soon as possible.
Thanks in advance.
Regards,
Assyst
Hi Assyst,
This is not a built in behavior of the grid. You will have to do this yourself. What you would need to do is to handle the column sorting client event and cancel it. In that event, off of the event args, you can get the column that was going to be sorted. You can see if it is sorted and if it is, then unsort it. But you would need to store yourself which direction to sort an unsorted column. You would also need to decide if you want to clear other columns' sorting if a different column is about sort. Hopefully this gets you started.
regards,
David Young
Hi Dave,
I have sorted it out. But how can we unsort a sorted column. There is only sort direction indicators (0,1,2). So can we?
Dude I had done it. Anyway thanks for the help. We need to clear out the sorted columns. Some extra stuff is needed. Your help in this manner is greatly appreciated.
I agree with that. But wont do any unsorting. If sorted in ascending/descending order then if sorted with 0-None nothing will happen. It just remain same as the way it get sorted previously. But I need the data just as the way before any ascending/descending is done.
So how can achieve that unsorting.
Thanks,
Hi,
These numbers match the SortDirection enum that we have on the server.
0- None, 1- Ascending, 2- Descending
regards,David Young