Gridview Sorting Using BoundField

Hello friends,

In this example, we will see how to “ Sort Gridview records based on Columns”

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

C# Code:


Run the application and just click on column name then u will get records in ascending and descending orders.






If you have any queries in this or regarding grid view post your comment or send mail to
ranjeetpatil4545@gmail.com

Thank You


No comments :

Post a Comment