I try to synchronize a row of GDBG with the fields of the selected record in simple controls (binded to the same datasource than the grid). When a row on the grid is clicked, the currency manager of the forms must display the value of the same records in the controls.
How can I do it? I don''t see a current row property.
Thanks a lot,
ADAdministrator Syncfusion Team May 24, 2004 10:26 AM
Is your grid in a GridRecordNavigationControl or a TabBarSplitterControl or some other container control? If so, make usre the grid.BindingContext is set to be that of the form. This should make it use teh same currency manager as other controls on the form.
this.gridDataBoundGrid1.BindingContext = this.BindingContext; //say in Form_Load
ADAdministrator Syncfusion Team May 25, 2004 12:42 AM
>Is your grid in a GridRecordNavigationControl or a TabBarSplitterControl or some other container control?
In fact, I have a grid (with two nested levels)on a form and on the right side, a tabpagecontrol with one page (with a set of controls) corresponding to data details of each node level. I will bind these two "controls". When a user click on a row, the correct tabpage is displayed and the control updated with the "current" data. If the user click on a tab (enabled only if the data exists), the grid is set to the correct row. I have used a grid because I can use nested relations in the dataset to automatically display the tree.
I have tried the code you show but without success :
this.DataGrid.BindingContext =this.tabControlAdv1.BindingContext or this.BindingContext;
ADAdministrator Syncfusion Team May 25, 2004 01:52 AM
If the items you are trying to bind to are not in the parent table, but in one of the child tables, then setting the BindingContext as above will not affect things.
The Currencymanager for these nested related tables come and go as your open and close the parent node for the tables. When the node is open, you can use teh GridBoudnrecordState to access the Currencymanager.
So, I do not think you will be able to easily binding to these nested tables using DataBinding.Add. But you can manually bind using the CurrentCellMoved event in the grid and the Leave event of your bound controls. Here is a little minimal sample. It binds two columns of the grandchild table in a 2 level hierarchy to two textboxes on the form. Maybe something like this will work for you.
EPEddy PoulletMay 27, 2004 05:25 AM
Thanks a lot, Clay. Very interesting !
I have just dicovered the TreeViewAdvDataBound in the help file. But I don''t see where is the sample demo nor the component.
Apparently there is only one dataset with grouping (and no nested datasets) in the sample. I believe that is a good feature -nested dataset-to add to the TreeViewAdvDataBound!
ADAdministrator Syncfusion Team May 27, 2004 06:00 AM
I have attached a sample application here that shows how databinding can be performed on a TreeViewAdv. Please refer to it and let me know if you need any additional information. Thanks for considering Syncfusion products.
EPEddy PoulletMay 29, 2004 02:17 AM
Very great sample! A true classe on complex data binding. Perfect for me with some improvments.
But one thing stay obscur to me in the code.
Is it correct in C# to cast an object (DataRelatedView) first in interface (IList), later cast it to the root object (object), and finally recast it in an another object(DataView -ancestor of DataRelatedView) ?
Thanks a lot,
EPEddy PoulletMay 29, 2004 07:36 AM
Again a question about the sample. What is the best method to update the treeviewnode:
ListChanged or ItemChanged Event.