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

Refresh after CancelCurrentEdit

How do you refresh the contents of a data bound grid afer cancelling the current edit on the underlying datasource Amd hints gratefully welcomed...

3 Replies

AD Administrator Syncfusion Team February 29, 2004 11:36 PM UTC

You can call grid.Refresh() or grid.RefreshRange(...) to force the grid to redraw itself with new data from the DataSOurce.

PD Paul Dorrell February 29, 2004 11:41 PM UTC

I''ve tried that, but it doesnt seem to work Heres my code... perhaps you can see something wrong ''Set up the grid with... Me.grdAsset.DataSource = Me.dsCustomer Me.grdAsset.DataMember = "select_customer.customer_asset" Dim assCol1 As New GridBoundColumn assCol1.MappingName = "cust_id" assCol1.HeaderText = "Cust" Dim assCol2 As New GridBoundColumn assCol2.MappingName = "country_group_id" assCol2.HeaderText = "Ctry" Dim dvAsset = New DataView(dsCustomer.Tables("select_country_group_list")) assCol2.StyleInfo.CellType = "ComboBox" assCol2.StyleInfo.DropDownStyle = GridDropDownStyle.Editable assCol2.StyleInfo.DataSource = dvAsset assCol2.StyleInfo.DisplayMember = "country_group_name" assCol2.StyleInfo.ValueMember = "country_group_id" assCol2.StyleInfo.ShowButtons = GridShowButtons.ShowCurrentCell Dim assCol3 As New GridBoundColumn assCol3.MappingName = "percentage" assCol3.HeaderText = "Pct" ''Me.grdAsset.GridBoundColumns.Add(assCol1) Me.grdAsset.GridBoundColumns.Add(assCol2) Me.grdAsset.GridBoundColumns.Add(assCol3) Me.grdAsset.Binder.InitializeColumns() ''Undo my changes with ..... Private Sub mnuDetailUndo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuDetailUndo.Click Me.BindingContext(dsCustomer, "select_customer").CancelCurrentEdit() Me.BindingContext(dsCustomer, "select_customer.customer_asset").CancelCurrentEdit() Me.grdAsset.Refresh() End Sub

PD Paul Dorrell March 1, 2004 01:24 AM UTC

No need... I''ve fixed it. Forgotten to reject the Changes Many thanks for the help

Live Chat Icon For mobile
Up arrow icon