开发者

How to stop DataGridView from polluting my Designer file with column controls?

开发者 https://www.devze.com 2022-12-28 10:49 出处:网络
I\'m sure you know the problem, as soon as a BindingSource is connected to a DataGridView the DataGridView generates columns for each Property found in the Type of the BindingSource\'s DataSource and

I'm sure you know the problem, as soon as a BindingSource is connected to a DataGridView the DataGridView generates columns for each Property found in the Type of the BindingSource's DataSource and adds that crap to the Form.Designer.cs file.

We only use run time generated columns, the clutter in the designer file is just waste of code, so how can we stop this "feature" of the DataGridView in WinF开发者_如何转开发orms?


Tell it to not auto-generate columns. http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.autogeneratecolumns.aspx


DataGridView.AutoGenerateColumns = false

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号