473,395 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DataGridView column order?

I've added an unbound column to a bound DataGridView, and I want the unbound
column to be the last column in the grid. But whenever I recompile, the
unbound column is the first column in the grid.

I'm guessing the problem has to do with the grid's AutoGeneratingColumns
property-- perhaps the bound columns are being autogenerated, which causes
the unbound column to slide to the left.

Is that what is happening? Will "AutoGenerateColumns = false" solve the
problem? where would I put the statement?

Thanks in advance.

--
David Veeneman
Foresight Systems
Jul 24 '06 #1
1 2720
Hi David,
I'm guessing the problem has to do with the grid's AutoGeneratingColumns property-- perhaps the bound columns are being
autogenerated, which causes the unbound column to slide to the left.

Is that what is happening?
I believe so.
Will "AutoGenerateColumns = false" solve the problem?
I don't think so because you'll lose all of your bound columns at runtime, unless this is acceptable.

For each column that is being auto-generated add a column to the DataGridView in the designer just as you would an unbound column,
but set the DataPropertyName for each bound column to the name of the DataColumn to which it is bound. You don't have to modify the
AutoGenerateColumns property if you setup the control like I've suggested. You could, however set AutoGeneratingColumns to false
so that you don't have to explicitly define all of the columns but the columns that are not explicitly defined will not be added at
runtime.

--
Dave Sexton

"David Veeneman" <da****@nospam.com (domain is my last name)wrote in message news:en**************@TK2MSFTNGP03.phx.gbl...
I've added an unbound column to a bound DataGridView, and I want the unbound column to be the last column in the grid. But
whenever I recompile, the unbound column is the first column in the grid.

I'm guessing the problem has to do with the grid's AutoGeneratingColumns property-- perhaps the bound columns are being
autogenerated, which causes the unbound column to slide to the left.

Is that what is happening? Will "AutoGenerateColumns = false" solve the problem? where would I put the statement?

Thanks in advance.

--
David Veeneman
Foresight Systems

Jul 25 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob | last post by:
During a form's development I noticed that when I changed bound dataset defintions with the dataset designer (for instance adding a column to one), when I come back and look at the form the...
3
by: Bob | last post by:
Thinking two things, 1- Creating a userControl -yeah you guessed it, a multi column drop down combobox - I've looked at several articles and did not find what I need, one that's bindable and that...
1
by: martin1 | last post by:
Hi, All, DataGridView is populated with all coumns from database since i need some columns data for condition statement, after that I want to show rest of column in the DataGridView, so how to...
3
by: Mike | last post by:
Dear group, I'm currrently investigating a bug within a piece of our software whereby if a DataGridView (bound directly to a DataTable) is ordered by column headers (containing lookup combo...
3
by: joey.powell | last post by:
I have a datagridview where I set its "DataSource" property to a DataSet and its "DataMember" property to a table within the DataSet. I need for the DataGridView to "sort" through the contents of...
0
by: bappelsin | last post by:
Hello, I have a problem with the datagridview. I have a view with around 25 different columns. To make life easier for the users I have implemented a popup dialog where the user can select which...
1
by: sklett | last post by:
I've got a strange situation here. I have a databound DataGridView that also has un-bound columns. When the view loads, I want to update the values of the unbound columns. If I attempt to modify...
7
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
1
by: trint | last post by:
Hello professionals, I have a datagridview that displays columns based upon my sql select statement. I have additional columns that I want displayed in the datagridview I wish to append to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.