Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2005

Tip: Looking for answers? Try searching our database.

Winforms Datagrid - detecting SORT

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lee Gillie - 12 Feb 2005 00:50 GMT
I'm trying to find an event that will help me keep a status area updated
for the grid row under the cursor.

For the most part when a user clicks somewhere in the readonly grid I am
responding to the cell change event, and selecting the entire row. A
custom paint reverses colors. This works great. Even after sorting, I
see how to use the currency manager to find the right dataset record to
show status for the right record in a separate area.

But when someone uses the built in sort feature, I don't get a change
position type event. I've fiddled with mouse-down, and mouse-up, and the
sort has not occurred yet. I am always showing stats for the PREVIOUS
highlighted record when I click a column heading for auto-sort. My
status window is always behind by one. But if the user picks a cell
after the sort, then everything is back in synch.

So I am looking for an event that I can respond to AFTER the sort has
actually happened, that I can update my status area for the new "current
row". It doesn't seem to be coming easily.

Any hints would be greatly appreciated.

Best regards - Lee Gillie, Spokane WA
Matt Garven - 14 Feb 2005 00:31 GMT
You should be able to hook into the ListChanged event on the list that the
grid is bound to. I believe the event args will have a ListChangeType of
"Reset" after a sort has occurred.

If you're bound to a DataTable then you need to hook into this event on the
DataView.

Hope this helps.

Regards,
Matt Garven

> I'm trying to find an event that will help me keep a status area updated
> for the grid row under the cursor.
[quoted text clipped - 19 lines]
>
> Best regards - Lee Gillie, Spokane WA

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.