By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,066 Members | 1,625 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,066 IT Pros & Developers. It's quick & easy.

Remembering Sort Order on WinForms DataGrid

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.