Re: Datagridview columns keep appearing
- From: "Brooke" <tbrooked@xxxxxxxxxxx>
- Date: Tue, 12 Jun 2007 14:45:10 -0500
I checked the code and it has the following
this.dataGridViewLookup.AutoGenerateColumns = false;
this.dataGridViewLookup.Columns.AddRange(new
System.Windows.Forms.DataGridViewColumn[] {
this.reviewID,
this.projectID,
this.drawingID,
this.reviewDescription});
Cannot find the problem...
"Jeremy Shovan" <jeremy.shovan@xxxxxxxxxxxxxxxxxxx> wrote in message
news:D626D984-C8EF-4B67-B393-33E73178EF18@xxxxxxxxxxxxxxxx
I am not sure but it sounds to me like the values from your datasource are
being grabed at design time and are then being serialized into your
designer.cs file.
When user controls are displayed at design time, visual studio is creating
instances of those controls. If you are loading data durring construction
of the control the designer will see those values and serialize them into
the code DOM (Dont quote me on this, it is just what I have observed).
To see if this is happening just open up your design.cs file and see if
the data is being included in your code. If this is what is going on try
moving the code that is creating the databinding into an if statement that
checks the this.DesignMode variable.
if(!this.DesignMode){
// do databinding here.
}
Jeremy Shovan
http://www.jeremyshovan.com
"Brooke" <tbrooked@xxxxxxxxxxx> wrote in message
news:uQ6UD3QrHHA.5032@xxxxxxxxxxxxxxxxxxxxxxx
I have a form with a datagridview and I set the columns that I want on the
grid. Whenever I close the form in the form designer and then open it
back up, it will pull in all of the columns from the binding source. I
have to manually edit the columns every time and remove all of the
unwanted ones. What is going on?
.
- Follow-Ups:
- Re: Datagridview columns keep appearing
- From: Jeremy Shovan
- Re: Datagridview columns keep appearing
- References:
- Datagridview columns keep appearing
- From: Brooke
- Datagridview columns keep appearing
- Prev by Date: does a singleton StatusBar controller sound corrrect?
- Next by Date: Re: does a singleton StatusBar controller sound corrrect?
- Previous by thread: Datagridview columns keep appearing
- Next by thread: Re: Datagridview columns keep appearing
- Index(es):
Relevant Pages
|