Hello friends,
In this example, we will see how to “ Sort Gridview records based on Columns”
In this example, I am using Employee Table
In this example, I am using Employee Table
Table script:
Source Code:
First, drag and drop Gridview control on a web form then go to gridview control properties
& Change AutoGenerateColumns="False" AllowSorting="True" then generate an Event Handler
For sorting method OnSorting="gridview1_Sorting" or simply copy & paste below code to your web form
& Change AutoGenerateColumns="False" AllowSorting="True" then generate an Event Handler
For sorting method OnSorting="gridview1_Sorting" or simply copy & paste below code to your web form
C# Code:
Run the application and just click on column name then u will get records in ascending and descending orders.
ranjeetpatil4545@gmail.com
Thank You
No comments :
Post a Comment