Click to See Complete Forum and Search --> : Datagrid TableStyle


skuehner
April 26th, 2006, 12:17 PM
Hello,

How can I evite that the user is able to put in a new line into a data grid at the end of the table?

Thanks!

skuehner
April 26th, 2006, 02:53 PM
I'm answering to my own question:

Instead of doing this:


BusProperties.DataSource=dataTable;


do this:


DataView dataView = new DataView(dataTable);
dataView.AllowNew = false;
BusProperties.DataSource=dataView;

jhammer
April 27th, 2006, 11:05 AM
And to make it shorter:

BusProperties.DataSource=dataTable;
dataTable.DefaultView.AllowNew = true;