0
votes

I am using Object Data Source to bind data in the gridview. I have set the property AllowSorting=true. While running the application, I could sort the data only in ascending order. Is there any way to achieve two way sorting in gridview ie. both ascending and descending on successive clicks ?.

Please give me a suggestion to solve this issue. Thanks in advance.

1
You need to store the sort direction and sort column in ViewState or Session for each grid, and then at the time you retrieve your datasource, apply the sort direction filter on it. Here's an article that explains it all: highoncoding.com/ArticleDetails.aspx?articleID=176 - Cᴏʀʏ
I cannot bind a DataSource manual, because I have a DataSourceID with the ID of the ObjectDataSource. If I kill the ID of the ObjectDataSource, I be not able to get the Delete-Method of the ObjectDataSource. - PassionateDeveloper
Your question has nothing to do with your problem. You dont say anything about binding or an issue with the DataSource. Please rewrite your question to reflect your problem. - Victor
And this is the 3rd question in a row you have asked about this stackoverflow.com/questions/4876660/… and here stackoverflow.com/questions/4876460/… - Victor
And? Nobody helps there, so I ask new questions until I get my answer - PassionateDeveloper

1 Answers

0
votes

there are many questions similar to this one.

here:

GridView sorting: SortDirection always Ascending

and here:

Gridview: capturing sort direction

and many more. please do a search