In my Windows form, I have a DataGridView component associated with a BindingSource. BindingSource is an object data source for an EntityFramework object.
The columns in my DataBridView are updated several times. Sometimes all properties are added as a column, but now it also deletes all my columns. Therefore, I lost all my settings.
When are columns automatically added?
(I am using VS.NET 2010)
Update:
// // Summary: // Gets or sets a value indicating whether columns are created automatically // when the System.Windows.Forms.DataGridView.DataSource or System.Windows.Forms.DataGridView.DataMember // properties are set. // // Returns: // true if the columns should be created automatically; otherwise, false. The // default is true. [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Advanced)] [DefaultValue(true)] public bool AutoGenerateColumns { get; set; }
The property did not appear in the designer, and "hide additional properties" is not checked.
Update 2: When I update the entity frame model, all columns are added again. I can set the property in the form constructor. This is very annoying.
source share