about windows form datagrid question

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Dear all,

I use datagrid to display my data.
But how should I do if I want the user can edit the data but can not add a
new row.
Thanks !!
 
Paul,

It's simple:

CurrencyManager cm = (CurrencyManager)this.BindingContext[grid.DataSource,
grid.DataMember];
DataView view = (DataView)cm.List;
view.AllowNew = false;

This code should be added right after you've called SetDataBinding on the
grid.


P.S. To all:

What do you think of posting a collection of links pointing to relevant FAQs
(C# language FAQ if exists, SyncFusion's WinForms FAQ etc.), say, once a
week? Nothing personal, but the question asked by Paul, and many others are
asked here quite often and I believe most of them are answered in the FAQs.
Not that I am reluctant to answer such questions, I am always happy to help
when I have some free time, but it would save everybody's time, wouldn't it?
 
Back
Top