Very odd Sort problem when modifying DGV bound data

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



(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



.



Relevant Pages

  • Re: help with VBA
    ... Within your loop you determine that you're at ... and know that you need to sort everything on all of the rows from 4 to this ... "indraneel" wrote: ... The first thing to do is to name the ranges you want sorted, ...
    (microsoft.public.excel.worksheet.functions)
  • Re: conciseness is power
    ... (maphash (lambda (normal words) ... (push words anagrams))) ... (loop for word = (read-line s nil) ... (loop for group in anagrams do (setf group (sort group #'string-lessp))) ...
    (comp.lang.lisp)
  • Re: fastest way to sort 2-D variant arrays?
    ... and then change the FSO loop section to loop through the ... array, and add the elements to the recordset using the AddNew statement. ... How would I write my variant array to the recordset? ... Here is something that I use on an ASP page to sort files by date there ...
    (microsoft.public.vb.general.discussion)
  • Re: Very odd Sort problem when modifying DGV bound data
    ... If you are using .Net 2.0, you might try putting a BindingSource between ... BindingSource myBindingSource = new BindingSource; ... specifying the Sort string via the DataTable.DefaultView.Sort property. ... DGV displays the items it makes a mess of it all. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: [PHP] Sort a while loop ?
    ... Sort a while loop? ... DC> 4 Dave 2345 ... DC> Checked by AVG anti-virus system. ...
    (php.general)