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.
Unfortunately, activation email could not send to your email. Please try again.

GDBG and DataView problem

Thread ID:

Created:

Updated:

Platform:

Replies:

22952 Dec 30,2004 04:04 AM Dec 30,2004 06:54 AM Windows Forms 1
loading
Tags: GridControl
Gil Kalo
Asked On December 30, 2004 04:04 AM

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 2.1.0.9 DataViewSample_9600.zip

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

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"); }

CONFIRMATION

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.

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.

;