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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GDBG and DataView problem

Thread ID:





22952 Dec 30,2004 09:04 AM UTC Dec 30,2004 11:54 AM UTC WinForms 1
Tags: GridControl
Gil Kalo
Asked On December 30, 2004 09:04 AM UTC

Hi, Having a GDBG, data set and AutoLabel, I''m doing the following: 1. Set the data set as the data source of the grid. 2. Bind "Text" property of the label to one of the columns in the data table. When running the app, when selection in the grid is changed, the binding causes to the label value to change as well. till now everything works fine. The problem begins, when I wrap the data table with data view, and assigns the data view as the data source of the grid. the label is still bound to the same column in data table. Now, the binding doesn''t seem to work. When selection in the grid is made, the label is not updated. Why this is happening? How can I use data view with GDBG and still use the binding? Attached to this message is a sample project I wrote which demonstrats the problem. Please response A.S.A.P Thanks, GilK P.S. I''m using syncfusion version DataViewSample_9600.zip

Administrator [Syncfusion]
Replied On December 30, 2004 11:54 AM UTC

In order for two databound controls to remain in sync, they must be using the same BindingContext. When you make the grid use a new DataView, it no longer uses the original bindingcontext to the datatable. So, you have two options. You can let the grid use datatable.DefaultView which is the default bindingcontext of the label. Or, you can let the grid use a new dataview, but also change the label to use the same dataview. private void button1_Click(object sender, System.EventArgs e) { DataView dv = new DataView(myTable1.Tbl1); gridDataBoundGrid1.DataSource = dv; autoLabel1.DataBindings.Clear(); autoLabel1.DataBindings.Add("Text",dv,"name"); }


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