The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I attached a sample solution to show my problem.
When Form1 is created a new row is added with Customer ID 1.
If I press ESC the row is removed.
I want to prevent this default row creation.
If the last line in Form1.cs is unmarked then two customers are created and no default row.
I can't find anything from MSDN help on this.
After the code that sets the DataSource property for your datagrid, add the following:
//no adding of new rows thru dataview...
CurrencyManager cm = (CurrencyManager)this.BindingContext[dataGrid1.DataSource, dataGrid1.DataMember];
((DataView)cm.List).AllowNew = false;
> I attached a sample solution to show my problem.
> When Form1 is created a new row is added with Customer ID 1.
> If I press ESC the row is removed.
> I want to prevent this default row creation.
> If the last line in Form1.cs is unmarked then two customers are created and no default row.
> I can't find anything from MSDN help on this.
>
>
GSGabriel SchwartzJuly 1, 2003 07:24 AM UTC
The following line throws an exception since
casting (cm.List as DataView) returns null;
((DataView)cm.List).AllowNew = false;
> After the code that sets the DataSource property for your datagrid, add the following:
>
> //no adding of new rows thru dataview...
>
> CurrencyManager cm = (CurrencyManager)this.BindingContext[dataGrid1.DataSource, dataGrid1.DataMember];
>
> ((DataView)cm.List).AllowNew = false;
>
> > I attached a sample solution to show my problem.
> > When Form1 is created a new row is added with Customer ID 1.
> > If I press ESC the row is removed.
> > I want to prevent this default row creation.
> > If the last line in Form1.cs is unmarked then two customers are created and no default row.
> > I can't find anything from MSDN help on this.
> >
> >
>