If your working with disconnected datasets that get bound to DataGridViews at runtime and you don't use the designer to preset the columns you may find yourself with empty rows or duplicate columns.
To fix the duplicate columns issue:
Add the following line to your code where you setup your datagridview(Example using DataGridView called dgrid).
this.dgrid.AutoGenerateColumns = false;
To fix the issue where you have blank rows and you know your dataset has the data:
Add the following line to your code where you set the properties of each column (Example using a DataGridViewColumn called dcol).
dcol.DataPropertyName = "name of column in datatable"
Friday, April 11, 2008
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment