Remove last raw on dataGrid

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
 
D

Dmitriy Lapshin

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top