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.
Hi
I have a Master Detail relationship using two datagrids, very similar to the sync sample DGTripleMasterDetails. But I wish to set the AllowNew to False, works fine for the Master table in Datagrid 1 but the Details table has no effect. Any help would be great!
...here is some code
CBAdapter = new OleDbDataAdapter("Select * From tblCashBook", CBConnect) ;
CBAdapterSplit = new OleDbDataAdapter("Select * From tblCashBookSplit", CBConnect) ;
CBDataset = new DataSet();
CBConnect.Open() ;
CBAdapter.Fill(CBDataset, "tblCashBook") ;
CBAdapterSplit.Fill(CBDataset, "tblCashBookSplit") ;
// Set Column Styles
DGCashBook_SetupColumnStyles();
DGCashBookSplit_SetupColumnStyles();
CBDataset.Relations.Add("CashBookToSplit", CBDataset.Tables["tblCashBook"].Columns["SplitNumber"], CBDataset.Tables["tblCashBookSplit"].Columns["SplitNumber"]);
this.DGCashBook.DataSource = CBDataset.Tables["tblCashBook"];
this.DGCashBookSplit.DataSource = CBDataset.Tables["tblCashBook"];
this.DGCashBookSplit.DataMember = "CashBookToSplit";
this.DGCashBook.AllowNavigation = false;
CBCmdBuilder = new OleDbCommandBuilder(CBAdapter);
CBCmdBuilderSplit = new OleDbCommandBuilder(CBAdapterSplit);
this.DGCashBook.Navigate += new NavigateEventHandler(DGCashBook_Navigate);
cm = (CurrencyManager)this.BindingContext[CBDataset.Tables["tblCashBook"]];
((DataView)cm.List).AllowNew = false;
cm2 = (CurrencyManager)this.BindingContext[CBDataset.Tables["tblCashBookSplit"]];
((DataView)cm2.List).AllowNew = false;
CBDataset.Tables["tblCashBook"].ColumnChanging += new DataColumnChangeEventHandler(this.DGCashBook_ColumnChanged);
CBDataset.Tables["tblCashBookSplit"].ColumnChanging += new DataColumnChangeEventHandler(this.DGCashBookSplit_ColumnChanged);
CBConnect.Close();