I have binded a datagridview to a datatable. But the gridview display开发者_如何学Cs an extra empty row at the bottom ? How should I hide it ? Thanks in Advance
The extra row is to manually add a line to your datagridview. If you don't need it you can disable it by disallowing the user to add rows:
this.dataGridView.AllowUserToAddRows = false;
You can try this:
CurrencyManager cm = myGrid.BindingContext[myGrid.DataSource, myGrid.DataMember]
as CurrencyManager;
DataView dv = cm.List as DataView;
dv.AllowNew = false;
精彩评论