Remove last raw on dataGrid

  • Thread starter Thread starter Chi Tang
  • Start date Start date
C

Chi Tang

Hi,

Does anybody know how to remove the last raw on a dataGrid control on a
Windows form? This raw is empty with a star sign on the first column. When
I click it some data become null. Thanks for any help,

CT
 
Hi Chi,

You can disable this row by doing the following:

CurrencyManager cm = (CurrencyManager)dataGrid.BoundContext[
dataGrid.DataSource,
dataGrid.DataMember];

DataView theView = (DataView)cm.List;
theView.AllowNew = false;

This code should be executed right after the grid has been bound to a data
source.
 
Back
Top