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
I''m using syncfusion version 18.104.22.168
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;