473,498 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting DataGrid Sort Column Header Name

relative noob.

i'm trying to get/display the column Header name that the user clicks
to sort on the DataGrid.

I know that i could take the e.SortExpression and spin through the
Columns on the DataGrid until I found the value that matches the
e.SortExpression and then grab the Header Name ... but I keep
thinking/hoping there is an easier way. I have searched through all
the e.* possibilities hoiping to find the Index # or something that
would tie it together.

any suggestions.

thank you
DIG

Nov 17 '05 #1
3 8252
Dig,

The latest clicked sort of a datagrid is in your underlying datasource

Datatable.DefaultView.Sort property
or
DataView.Sort property

(A dataview is the same as the inbuilt dataview defaultview)

I hope this helps,

Cor
Nov 17 '05 #2

Cor Ligthert [MVP] wrote:
Dig,

The latest clicked sort of a datagrid is in your underlying datasource

Datatable.DefaultView.Sort property
or
DataView.Sort property

(A dataview is the same as the inbuilt dataview defaultview)

I hope this helps,

Cor


cor,

perhaps i'm missing something here, but this seems as though this will
just get me the sort expression used and not access to the column name.

I'm trying to get this during my DataGrid SortCommand event.

thank you
dig

Nov 17 '05 #3
I thought that you asked for an easier method to get the column. That is in
my opinion the sort expression (with extra Desc or ASC).

Cor

"DigHazuse" <di*******@msn.com> schreef in bericht
news:11**********************@g49g2000cwa.googlegr oups.com...

Cor Ligthert [MVP] wrote:
Dig,

The latest clicked sort of a datagrid is in your underlying datasource

Datatable.DefaultView.Sort property
or
DataView.Sort property

(A dataview is the same as the inbuilt dataview defaultview)

I hope this helps,

Cor


cor,

perhaps i'm missing something here, but this seems as though this will
just get me the sort expression used and not access to the column name.

I'm trying to get this during my DataGrid SortCommand event.

thank you
dig

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9905
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
1
8891
by: Webgour | last post by:
Hi, I'm tring to add a column to a datagrid with a linkbutton as header that can be used to sort the column. The column and the linkbutton are added programmatically (see below). However the...
0
1688
by: VMI | last post by:
My Windows datagrid has two columns: one with the data that the user will see (col_X) and the other one (a hidden one: col_sort) that'll be used to sort data. When a user clicks on col_X's column...
0
1809
by: Sam Vanderstraeten | last post by:
Hi All, - Visual Studio 2002 - VB.NET > ASP.NET I created a DataGrid on a webform. This datagrid has sorting enabled. I want to create in the header of each column (that is a...
1
2331
by: Jeremy | last post by:
I want my gird to sort only the items on the current page when I click on a column header. I wrote a little test app, but when I sort it pulls in items from other pages and places them on the current...
1
2677
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
1
5290
by: nate axtell | last post by:
In VB .NET I load the contents of an Excel or comma seperated values file into a dataGrid (via a datatable). One of the columns has a comma in the name of the column. So for the comma separated...
0
2707
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
2
6557
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
0
7121
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6993
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7197
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.