Re: Datagridview columns keep appearing

Tech-Archive recommends: Fix windows errors by optimizing your registry



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?






.



Relevant Pages

  • Re: Provider Properties + IExtenderProvider
    ... The IExtenderProvider only enables you to add a property at design time. ... on the operation of the extender provider. ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... It seems I can provide properties, like> strings, bools, ints, but not events to other controls. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: need to add textboxes to userform on the fly
    ... Sorry Bob, ... design time and adapting their Visible, ... >It is indeed possible to add controls tom a userform on ... >Dim newButton As MSForms.Control ...
    (microsoft.public.excel.programming)
  • Re: create design time library using vs.net
    ... > writing controls with design time support isn't the issue, my controls also> have design time support which works just peachy. ... >>> multiple places; using definition from ... You must add a reference to assembly ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Cool calm and collective BUG!!!!
    ... Right, I've found the problem, for some reason or another the controls ... Surely it should be design time until I ... >> When devloping class libraries I have always had troubles with the ...
    (microsoft.public.dotnet.languages.vb)
  • CreateChildControls(...) or Render(...)?
    ... Should I create controls for a composite WebControl in the ... CreateChildControl or the Render method? ... is not called at design time when the control is on a page being designed. ... Private m_QuestionLabel As New WebControls.Label ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)