We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

AllowNew Master Details 2 Datagrids

Thread ID:




21327 Nov 8,2004 03:18 AM UTC WinForms 0
Tags: FAQ
Asked On November 8, 2004 03:18 AM UTC

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();


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon