S
shuckjunkmail
It was suggested that I re-submit this question as a new post rather
than adding onto an old and unanswered post.
The basic problem has to do with the .NET datagrid and sorting. I am
having trouble getting the correct row of data from the datagrid
immediately after re-sorting the datagrid. I am using the dataview for
accessing the data and am using the following code as previously
mentioned in a different post:
Dim bm As BindingManagerBase = grdBaseRates.BindingContext( _
grdBaseRates.DataSource, _
grdBaseRates.DataMember)
Dim dr As DataRow = CType(bm.Current, DataRowView).Row
I'm currently handling the "click" event in my code and this gets
raised every time I click on the header of a column to re-sort the
data. However, this event seems to get raised BEFORE the grid has been
re-sorted. Thus, I sort by column 1, the event is raised, I handle the
event in my code but get the row associated with my initial form load
sort. Then I sort by column 2, the event is raised and I get the row
associated with the sort by column 1. I sort by column 3, the event is
raised and I get the row associated with the sort by column 3. etc. I'm
always 1 step behind because the event seems to happen before the grid
has been re-sorted.
Is there an event I can handle that happens AFTER the sort? Is
there another way to handle this?
Thanks in advance,
-Mike
Risetime Consulting
than adding onto an old and unanswered post.
The basic problem has to do with the .NET datagrid and sorting. I am
having trouble getting the correct row of data from the datagrid
immediately after re-sorting the datagrid. I am using the dataview for
accessing the data and am using the following code as previously
mentioned in a different post:
Dim bm As BindingManagerBase = grdBaseRates.BindingContext( _
grdBaseRates.DataSource, _
grdBaseRates.DataMember)
Dim dr As DataRow = CType(bm.Current, DataRowView).Row
I'm currently handling the "click" event in my code and this gets
raised every time I click on the header of a column to re-sort the
data. However, this event seems to get raised BEFORE the grid has been
re-sorted. Thus, I sort by column 1, the event is raised, I handle the
event in my code but get the row associated with my initial form load
sort. Then I sort by column 2, the event is raised and I get the row
associated with the sort by column 1. I sort by column 3, the event is
raised and I get the row associated with the sort by column 3. etc. I'm
always 1 step behind because the event seems to happen before the grid
has been re-sorted.
Is there an event I can handle that happens AFTER the sort? Is
there another way to handle this?
Thanks in advance,
-Mike
Risetime Consulting