473,473 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Remembering Sort Order on WinForms DataGrid

Hello,

Is it possible to retrieve and set the sort order for a DataGrid
control on a WinForm? I had a user request this functionality, and I
can't seem to find a place to set and retrieve it from. Am I missing
something, or is this something that is more difficult to do than is
worth the time?

Thanks in advance!

Joseph

Mar 30 '06 #1
2 1541
Joseph,

Your surely miss something because it is easy to do.

For that is the DataView or the DefaultView. Which is a view on a datatable.
In that DataView or Defaultview there is a property Sort. You can set that
while you can get the current value if a user changes that by clicking at
the top of the grid.

myDataTable.Defaultview.Sort = "MySecondColumn"

I hope this helps,

Cor

"Joseph Ferris" <jo***********@gmail.com> schreef in bericht
news:11**********************@t31g2000cwb.googlegr oups.com...
Hello,

Is it possible to retrieve and set the sort order for a DataGrid
control on a WinForm? I had a user request this functionality, and I
can't seem to find a place to set and retrieve it from. Am I missing
something, or is this something that is more difficult to do than is
worth the time?

Thanks in advance!

Joseph

Mar 31 '06 #2
Cor,

Yep. Missed the obvious. I knew that if I stepped away from it and
asked, it would save me a lot of aggrevation in the long run.

Thank you for helping me conserve what little hair I have left!

Joseph

Mar 31 '06 #3

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

Similar topics

0
by: Martin Clark | last post by:
Hi, I have a C# Windows .net application (not asp.net) which uses a datagrid to display information. The datagrid is populated from a DataView, in which I specify a sort order ("ORDER BY...
0
by: Tom Hughes | last post by:
I want to change one field of all selected rows to a provided value. Problem 1 I am using the Binding Manager Base to bind the datagrid to the appropriate dataTable as recommended by KB817247....
5
by: Bill Todd | last post by:
In a WinForms application with a DataGrid bound to a DataTable, if I change the DefaultDataView.Sort property the order of the data in the grid does not change. If I change the Sort property...
7
by: DC Gringo | last post by:
I have a datagrid that won't sort. The event handler is firing and return label text, just not the sort. Here's my Sub Page_Load and Sub DataGrid1_SortCommand: -------------------- Private...
1
by: Hrvoje Vrbanc | last post by:
Hello all! I would be grateful if someone could offer me some help with the following problem: I have a DataGrid control with sort enabled. Therefore it could be sorted in several different...
5
by: Kurt Schroeder | last post by:
I'm using VS.net. I have created a component with the basic set of database commands. This component returns a record set that is bound to a datagrid. I want to add a dynamic sort, but am not sure...
1
by: Jean-Claude Bertrand | last post by:
Hi! Windows of the application IO have to built (my first one in vb.Net) is made from 2 part: a) A grid wich will be used only to display the main information of the current record (so the...
3
by: Marco | last post by:
Hi, I'm new to datagrids and was hopping to get some help. I tried to bind an arraylist to a datagrid but the columns seem to be displayed in a random order for some reason. Is there someway that...
0
by: Reddy4All | last post by:
Hi- Is there any possiblity to make Datagrid control (Winforms) column header sort arrow more prominent in .net 2003. In Windows forms Datagrid control, when user click on the column header, default...
0
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.