开发者

Hide the extra row at the bottom in a DataGridview in a Winform Application

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;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜