Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

while opening the layout editor, sometimes it adds columns from the datasource to the DataGridView.
But this ouccurs not for all DataGridViews in my projects, only some and not from creating the Form. After first appear, the problem persists on the affected DataGridView.
Deleting the DataGridView and recreate it new, will help only in some cases.

I think, there will be a confusion in the desinger code, generated from the layout editor, but while trying some changes I found no approach.

Remarks:
In the generated code AutoGenerateColumns is set to false.
Posted
Updated 22-Oct-12 3:13am
v5

"Played around" with some settings, I found a mismatch between columns count and the
XXX.UserAddedColumn entrys in the resx file of the form. After deleting all of these entrys, the layout editors hiccup is stopped.

I don't know why, but it helps me this time.
 
Share this answer
 
hello i think You should set the Property autogeneratecolumns of datagridview=false
 
Share this answer
 
Comments
BlackMilan 22-Oct-12 9:15am    
No sorry doesn't help, AutoGenerateColumns is always set to false.
Devang Vaja 22-Oct-12 9:18am    
check the query and dataset which you r binding to the datagridview and also see which columns are there as bounded and template field in datagrid
BlackMilan 23-Oct-12 2:42am    
no query, datasource is a datatable or dataview from dataset

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900