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
close icon

Synchronize GridDataBoundGrid

Hi, 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, Eddy POULLET Brussels

7 Replies

AD Administrator Syncfusion Team May 24, 2004 03:26 PM UTC

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

AD Administrator Syncfusion Team May 25, 2004 05:42 AM UTC

Hi, >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; Thanks, Eddy POULLET Brussels

AD Administrator Syncfusion Team May 25, 2004 06:52 AM UTC

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. forum_FormBinding_3194.zip

EP Eddy Poullet May 27, 2004 10:25 AM UTC

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! Eddy POULLET Brussels

AD Administrator Syncfusion Team May 27, 2004 11:00 AM UTC

Hi Eddy, 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. Regards, Guru Patwal Syncfusion, Inc.

EP Eddy Poullet May 29, 2004 07:17 AM UTC

Hi Guru, 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, Eddy POULLET Brussels

EP Eddy Poullet May 29, 2004 12:36 PM UTC

Again a question about the sample. What is the best method to update the treeviewnode: ListChanged or ItemChanged Event. Thanks again, Eddy POULLET Brussels

Live Chat Icon For mobile
Up arrow icon