468,491 Members | 2,038 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,491 developers. It's quick & easy.

datagrid sort order

i have a win form w/ a datagrid inside
while the app is running many instances of this form r created and closed
how can i ensure that the sort user used last time is kept until the whole
app is
closed

TIA
Nov 20 '05 #1
4 3463
John:

Here's my answer from the WindowsForms ng
Create a DataView as a static property and bind everything to it. If you
need seperate datasources with the same sort order, same thing... static
class storing the Index of the column you want sorted on . Every time you
bind the grid, set the sort order (ideally of a dataview) to that
columnindex.

If you are in VB.NET, you can just use modules if you are uncomfortable with
Static properties, they are quite similar.

HTH,

Bill

www.devbuzz.com
www.knowdotnet.com
"John Smith" <a_*@abv.bg> wrote in message
news:#R**************@TK2MSFTNGP12.phx.gbl...
i have a win form w/ a datagrid inside
while the app is running many instances of this form r created and closed
how can i ensure that the sort user used last time is kept until the whole
app is
closed

TIA

Nov 20 '05 #2
Hi John,

When you create a dataview you can save the last sortorder as
\\\
Dim sortcolumnAndOrder As String = dv.Sort
////
However only the last column that is clicked not multiple columns.

I hope this helps?

Cor
Nov 20 '05 #3
tnx, ill try - but its not too simple :((
"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:O6**************@TK2MSFTNGP09.phx.gbl...
John:

Here's my answer from the WindowsForms ng
Create a DataView as a static property and bind everything to it. If you
need seperate datasources with the same sort order, same thing... static
class storing the Index of the column you want sorted on . Every time you
bind the grid, set the sort order (ideally of a dataview) to that
columnindex.

If you are in VB.NET, you can just use modules if you are uncomfortable with Static properties, they are quite similar.

HTH,

Bill

www.devbuzz.com
www.knowdotnet.com
"John Smith" <a_*@abv.bg> wrote in message
news:#R**************@TK2MSFTNGP12.phx.gbl...
i have a win form w/ a datagrid inside
while the app is running many instances of this form r created and closed how can i ensure that the sort user used last time is kept until the whole app is
closed

TIA


Nov 20 '05 #4
i`ll try this too

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:Oq**************@tk2msftngp13.phx.gbl...
Hi John,

When you create a dataview you can save the last sortorder as
\\\
Dim sortcolumnAndOrder As String = dv.Sort
////
However only the last column that is clicked not multiple columns.

I hope this helps?

Cor

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Martin Clark | last post: by
5 posts views Thread by Bill Todd | last post: by
1 post views Thread by Maqsood Ahmed | last post: by
2 posts views Thread by Snig | last post: by
2 posts views Thread by enak | last post: by
7 posts views Thread by DC Gringo | last post: by
5 posts views Thread by Kurt Schroeder | last post: by
reply views Thread by Nathan Franklin | last post: by
reply views Thread by rn5a | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by theflame83 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.