Solved

AutoGenerateColumns property missing from the DataGridView

Posted on 2009-05-08
3
813 Views
Last Modified: 2013-12-17
Hi Experts,
Keep a DataGridView from generating columns when it is bound.
I would like to use the AutoGenerateColumns property and set it programmatically to false but it seems to be missing from the DataGridView class.
0
Comment
Question by:tonySchlein
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
abel earned 500 total points
ID: 24339226
Intriguing. I just tried and I can do this:

Does that give an error for you?

DataGridView gv = New DataGridView();
gv.AutoGenerateColumns = false;

Open in new window

0
 

Author Comment

by:tonySchlein
ID: 24354174
I pasted your snippet in and did not get an error.
So it turns out that the problem is simply that the AutoGenerateColumns property did not show up in intellisense and I assumed that it was not present. PBKAC.
Not so intriguing after all. Oh well. Thanks for the help.
0
 
LVL 39

Expert Comment

by:abel
ID: 24354289
you're welcome. Sometimes the intellisense is not what it seems. And sometimes, it even deliberately removes items from the dropdown list of options, for instance the String extension methods are not shown (the ones that act on IEnumerator<string> and are predefined). They did so to prevent cluttering,

Though your situation just seems a minor bug. Try to install all recent fixes including SP1, and see if that helps...
0

Featured Post

CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question