Introduction:
Here I will explain how to sort gridview
columns based on dropdownlist
selection in asp.net using Order By clause in SQL
Server. Whenever we are trying to sort a gridview
or Repeater through the dropdownlist
we used to add either switch case or if else condition. So there will be too
many conditions as the list of the dropdownlist
increases and every time you have to change in code behind (adding conditions
or delete conditions). While doing one of my projects I found its solutions
myself and going to share with you.
Description:
Previously we have discussed about Sorting
Columns in Repeater Control in Asp.net using C#, How
to show the up and down arrows during sorting of column in gridview using
asp.net and today we will show how to sort gridview
columns based on dropdownlist
selection in asp.net using Order By clause in SQL
Server.