• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 701
  • Last Modified:

vb.net 2008 sort datagridview

Guys,

How to sort data in datagridview by click on the datagridview header.
0
aarontham
Asked:
aarontham
1 Solution
 
Ryan ChongCommented:
try like:

<asp:GridView ID="GridView1" runat="server"
                                            AllowSorting="True"

...>

then in the columns:

<asp:BoundField DataField="category" HeaderText="Category"
                                                    SortExpression="category" />
                                                <asp:BoundField DataField="item" HeaderText="Item Name"
                                                    SortExpression="item" />
0
 
DhaestCommented:
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
I don't understand the question because datagridview does that by default.
Can you clarify ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now