S
sklett
(I posted this in a databinding NG, but it's a VERY low traffic NG so I
thought I would post here as well. I hope no one minds too much, if you do
I'm sorry)
I have a DGV that is bound to a DataTable that is loaded during application
startup. I can sort with all the columns and everything works fine. I have
a method that can be invoked from a context menu that will loop through the
rows of the bound table and modify a specific cell in each row. After
modifying the rows sorting doesn't work for that column anymore.
To give a more familiar example:
Load the Products table from the Northwind DB
Bind to a DGV via a BindingSource object
Test teh sorting by clicking on the DGV columns
add a button and in the click handler, loop through the DataRow collection
and set the ProductID column to the value using an int that increments in
the loop.
Try and sort the ProductID column.
You will get incorrect results, it will sort 20 or so rows, then jump to
another number, then jump again.. it's broken.
I've tried everything I can think of:
calling EndEdit on each row
reseting bindings
etc
Nothing seems to solve it. I'm not one to cry "bug" but this sure seems
like one to me.
Anyone ever experience this? Anyone happen to have a demo application setup
with Northwind they could quickly check this? I've spent over a week now
trying to find the problem and I can't.
Any help or input greatly appreciated!
Thanks for reading,
Steve
thought I would post here as well. I hope no one minds too much, if you do
I'm sorry)
I have a DGV that is bound to a DataTable that is loaded during application
startup. I can sort with all the columns and everything works fine. I have
a method that can be invoked from a context menu that will loop through the
rows of the bound table and modify a specific cell in each row. After
modifying the rows sorting doesn't work for that column anymore.
To give a more familiar example:
Load the Products table from the Northwind DB
Bind to a DGV via a BindingSource object
Test teh sorting by clicking on the DGV columns
add a button and in the click handler, loop through the DataRow collection
and set the ProductID column to the value using an int that increments in
the loop.
Try and sort the ProductID column.
You will get incorrect results, it will sort 20 or so rows, then jump to
another number, then jump again.. it's broken.
I've tried everything I can think of:
calling EndEdit on each row
reseting bindings
etc
Nothing seems to solve it. I'm not one to cry "bug" but this sure seems
like one to me.
Anyone ever experience this? Anyone happen to have a demo application setup
with Northwind they could quickly check this? I've spent over a week now
trying to find the problem and I can't.
Any help or input greatly appreciated!
Thanks for reading,
Steve