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

Synchronize GridDataBoundGrid

Thread ID:





14282 May 24,2004 01:24 PM UTC May 29,2004 12:36 PM UTC WinForms 7
Tags: GridControl
Eddy Poullet
Asked On May 24, 2004 01:24 PM UTC

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

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On 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

Eddy Poullet
Replied On 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

Administrator [Syncfusion]
Replied On 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.

Eddy Poullet
Replied On 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

Eddy Poullet
Replied On 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


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