473,386 Members | 1,644 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,386 software developers and data experts.

True or False?

State True or False: If you set AutoGenerateColumns=True and still provide
custom column definitions, the DataGrid will render both.

o True

o False

Someone said true but someone said false. Which is right?

Thanks.


Jun 16 '06 #1
2 2412
Clarification: do you mean
System.Web.UI.WebControls.DataGrid.AutoGenerateCol umns or
System.Windows.Forms.DataGridView.AutoGenerateColu mns? (perhaps this is the
reason for 2 answers?)

I don't know about the web one. From some windows-forms work I was doing
just the other day, I will say true - under the following conditions, at
least:

* set the data-source to typeof(MyClass) [for object binding]
* add the desired columns manually
* set the data-source to a List<MyClass>

This resulted in duplicated columns; setting AutoGenerateColumns to false
fixed it for me.

Marc
Jun 16 '06 #2
Just to add more confusion... One of the oddities I've experienced with the
forms designer is having a DataGridView sometimes auto generate duplicate
columns (from my custom ones) even though AutoGenerateColumns was never
changed. It may be that somebody experienced that and thought it was the
normal behavior.

"Marc Gravell" <ma**********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Clarification: do you mean
System.Web.UI.WebControls.DataGrid.AutoGenerateCol umns or
System.Windows.Forms.DataGridView.AutoGenerateColu mns? (perhaps this is
the reason for 2 answers?)

I don't know about the web one. From some windows-forms work I was doing
just the other day, I will say true - under the following conditions, at
least:

* set the data-source to typeof(MyClass) [for object binding]
* add the desired columns manually
* set the data-source to a List<MyClass>

This resulted in duplicated columns; setting AutoGenerateColumns to false
fixed it for me.

Marc

Jun 16 '06 #3

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

Similar topics

46
by: Scott Chapman | last post by:
There seems to be an inconsistency here: Python 2.3.2 (#1, Oct 3 2003, 19:04:58) on linux2 >>> 1 == True True >>> 3 == True False >>> if 1: print "true" ....
3
by: drs | last post by:
I just upgraded my Python install, and for the first time have True and False rather than 1 and 0. I was playing around at the command line to test how they work (for instance, "if 9:" and "if...
35
by: Steven Bethard | last post by:
I have lists containing values that are all either True, False or None, e.g.: etc. For a given list: * If all values are None, the function should return None.
14
by: Walter Dnes (delete the 'z' to get my real address | last post by:
I took a C course some time ago, but I'm only now beginning to use it, for a personal pet project. My current stumbling-block is finding an efficient way to find a match between the beginning of a...
48
by: Skybuck Flying | last post by:
Hi, I came across this C code which I wanted to understand etc it looked like this: if (-1) etc It made me wonder what the result would be... true or false ? In C and Delphi
1
by: Edward | last post by:
I am having a terrible time getting anything useful out of a listbox on my web form. I am populating it with the results from Postcode lookup software, and it is showing the results fine. What...
4
by: Wayne Wengert | last post by:
I am using VB in a VSNET 2003 Windows application. I've run into a situation where, when trying to set a bit value in a SQL Server 2000 database I get errors because the values extracted from a...
59
by: Pierre Quentel | last post by:
Hi all, In some program I was testing if a variable was a boolean, with this test : if v in My script didn't work in some cases and I eventually found that for v = 0 the test returned True ...
30
by: Jason | last post by:
I am fairly new to ASP--I have been using it about 2 months. I did these tests (below), and it doesn't make sense to me. False is equal to 0, and that's fine. True should be equal to 1, but it's...
71
by: David T. Ashley | last post by:
Where is the best place to define TRUE and FALSE? Are they in any of the standard include files, ever? Do any standards apply? What I've traditionally done is something like: #ifndef...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.