Data-bound DataGridView reshuffles columns

SoftwareEng

Senior member
Apr 24, 2005
553
4
81
We are using a data-bound grid (DataGridView) in VB.NET 2.0. It's bound to a table adapter in the data designer.

But the grid randomly reorders columns, and I have to order them back. This happens once or more per day, and is very annoying - we have to check for this before every build.

What causes columns to get reordered like this?

thanks.
 

SoftwareEng

Senior member
Apr 24, 2005
553
4
81
Originally posted by: KB
Looks like it is a fairly common problem: http://social.msdn.microsoft.c...e72-a12b-07948b066b5a/
http://www.xhydra.com/bugsnipe...elves-after-build.html

and MS didn't fix it. Everyone recommends Dhaval00's solution.

I have never experienced this bug because I use the Infragistics ultrawingrid, which is 100 times better. If you can use any third party datagrid I would recommend it otherwise you are SOL from getting help from MS.


Nice! See, there are things people know that Google can't find :) This helps, thanks for your response!
 

imported_Dhaval00

Senior member
Jul 23, 2004
573
0
0
As a side note, I've never used freaking TableAdapters in any of my projects. I never thought they provided the finer control required to manipulate the data. It could be that I am just a control-freak :). Usually, I'll wait it out with M$'s newer tools, but I had read about all the problems people were having with TableAdapters beforehand. Now, times have changed... I can actually go attend a few launch events and get to know [superficially] if the next big thing from M$'s labs will be mature enough. I jumped the gun on LINQ and SSIS because both of them looked mature... I guess the glass walls will keep crumbling down one of these days!
 

presidentender

Golden Member
Jan 23, 2008
1,166
0
76
Originally posted by: Dhaval00
As a side note, I've never used freaking TableAdapters in any of my projects. I never thought they provided the finer control required to manipulate the data. It could be that I am just a control-freak :). Usually, I'll wait it out with M$'s newer tools, but I had read about all the problems people were having with TableAdapters beforehand. Now, times have changed... I can actually go attend a few launch events and get to know [superficially] if the next big thing from M$'s labs will be mature enough. I jumped the gun on LINQ and SSIS because both of them looked mature... I guess the glass walls will keep crumbling down one of these days!

:thumbsup: I tried to use a TableAdapter in this project. That was a miserable failure. As ridiculous as I feel rolling my own data bindings, that's been the quickest way to do it so far.
 

SoftwareEng

Senior member
Apr 24, 2005
553
4
81
Originally posted by: presidentender
Originally posted by: Dhaval00
As a side note, I've never used freaking TableAdapters in any of my projects. I never thought they provided the finer control required to manipulate the data. It could be that I am just a control-freak :). Usually, I'll wait it out with M$'s newer tools, but I had read about all the problems people were having with TableAdapters beforehand. Now, times have changed... I can actually go attend a few launch events and get to know [superficially] if the next big thing from M$'s labs will be mature enough. I jumped the gun on LINQ and SSIS because both of them looked mature... I guess the glass walls will keep crumbling down one of these days!

:thumbsup: I tried to use a TableAdapter in this project. That was a miserable failure. As ridiculous as I feel rolling my own data bindings, that's been the quickest way to do it so far.

I've been working with TableAdapters for over two years now. If used correctly and appropriately, they are a huge time-saver WITH some fine data control.

First off, you don't have to use binding with them. The biggest advantage is the strict data typing they give you, which prevents tons of errors. Second is the easy checking for Null and the ability to attach a function to your data, like a Fill or Update method.

Most programmers still end up writing their own wizard to generate DB-connected code to read the DB schema and create classes based on it. This is just for us.