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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DBDG--Making grid match back-end database

Thread ID:





34680 Sep 14,2005 01:34 PM UTC Sep 15,2005 08:46 AM UTC WinForms 3
Tags: GridControl
dan carr
Asked On September 14, 2005 01:34 PM UTC

I set up a DBDG using the wizard--i.e. create dataadapter, create dataset, base DBDG on dataset When a user enters dup information or something else NOT allowed by the database I catch the error (Try..Catch block--see below) but the DBDG is not updated to display this. i.e. If ''Name'' must be unique (in database) and user enters ''John'' 50X in the grid it will appear only once in the database but 50X in the grid. Same thing applies to deleting records which are/have foreign keys: won''t be deleted from DB but will be deleted from DBDG. Not sure if I should refresh the DBDG or actively delete/add the current cell Try Me.adpGroup.Update(Me.dtsGroup1.sct_Group) Catch ex As Exception errorMessage = ex.Message.ToString() errorMessage = "Group " + CStr(Me.grdGroup(rowIndex, 1).CellValue) + " NOT UPDATED. " + errorMessage ''SOMETHING MUST BE DONE HERE Finally Me.stpErrors.Text = eventDisplay + errorMessage End Try

Administrator [Syncfusion]
Replied On September 14, 2005 02:59 PM UTC

After, getting the error, try calling Refresh on the CurrencyManager to see if this will handle this problem. CurrencyManager cm = me.grid.BindingContext(me.grid.DataSource, me.grid.DataMember) cm.Refresh()

dan carr
Replied On September 14, 2005 03:55 PM UTC

Did not work. Record still appears (even though not inserted in DB) Added: Dim cm As CurrencyManager = Me.grdGroup.Binder.BindingContext(Me.grdGroup.DataSource, Me.grdGroup.DataMember) cm.Refresh() Thanks, Dan

Administrator [Syncfusion]
Replied On September 15, 2005 08:46 AM UTC

Hi Dan, Your Direct Trac incident id 20955 is updated. Regards, Stanley


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

or the page will be automatically redirected to 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