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

Syncing Hierarchial GDBG with MS DataGrid

Pls find attached code sample. In the code example you will see that there are three grids laid out, 2 of them are MS Datagrid and the other is Hierarchial GDBG. What i want is when user scrolls in HGDBG, i want the corresponding child rows to get reflected in MS datagrid. This works in case of MS Grid where any position change in one grid reflects in another grid but not happening in HGDBG. Regards Yogi

gridtree.zip

6 Replies

AD Administrator Syncfusion Team May 3, 2006 07:15 PM UTC

Would appreciate if anyone from syncfusion can look into this problem. Tks in advance.


AD Administrator Syncfusion Team May 4, 2006 04:36 AM UTC

Hi Yohi, You need to add this line in Form''s load event.Here is a code snippet. gridDataBoundGrid1.Binder.SetDataBinding(dataset11 , "ParentTable"); Here is a modified sample. http://www.syncfusion.com/Support/user/uploads/gridtree_619e446a.zip Please let me know if this helps. Best Regards, Haneef


AD Administrator Syncfusion Team May 4, 2006 02:49 PM UTC

Thanks Haneef. The changes you made works fine for the parent row. So if i scroll to next parent row i see a row pointer change in MS Data Grid. But what i want is the same behavior for child row. So for eg. in the code sample attached previously, if u scroll to child row then i see no change in row pointer behavior in MS Grid. For eg. Lets say there are two grid control. Hierarchy GDBG displays both parent and child rows in tree fashion where the other grid displays only child rows. So when user expands the parent node and scrolls to child row, i c the row getting filtered out in the other grid for that particular parent row, but what is not happening is when user scrolls, the curent row position pointer is not changed in the other grid. So when i query on currencymanager for current position on that other MS grid i get value 0. Let me know if u need more explanation. Tks once again >Hi Yohi, > >You need to add this line in Form''s load event.Here is a code snippet. > >gridDataBoundGrid1.Binder.SetDataBinding(dataset11 , "ParentTable"); > >Here is a modified sample. >http://www.syncfusion.com/Support/user/uploads/gridtree_619e446a.zip > >Please let me know if this helps. >Best Regards, >Haneef


AD Administrator Syncfusion Team May 9, 2006 12:54 PM UTC

Hi Yogi, My apologies for the delayed response. If you want changing the position in the childtable of a DataboundGrid to automayically affect a position change in a MS DataGrid, then the the datagrid and the DataboundGrid must be using the same datasource. The childtable of a hierarchical DataboundGrid is only know when the node is expanded. So, one thing you could try is to handling the RowsExpended and RowsCollapsed events in the DataboundGrid and set this dynamic childtable to be the datagrid''s datasource at that point. Attached is his form1.cs file with this change. If you expand the DataboundGrid and move teh current position in the DataboundGrid, the top right datagrid position will change too. Depending upon the exact behavior you want, you may have to explicitly handle position changed events in one or both type of grids, and then manually set the position in the other grids. Here is a form.cs file http://www.syncfusion.com/Support/user/uploads/Form1_ba2ae191.cs Please let me know if this helps. Thanks for choosing Syncfusion Products. Best Regards, Haneef


AD Administrator Syncfusion Team May 9, 2006 01:24 PM UTC

Haneef, I can''t download this file.. looks to me a security issue..can u zip it and upload it back again.. Tks Regards Yogi >Hi Yogi, > >My apologies for the delayed response. > >If you want changing the position in the childtable of a DataboundGrid to automayically affect a position change in a MS DataGrid, then the the datagrid and the DataboundGrid must be using the same datasource. The childtable of a hierarchical DataboundGrid is only know when the node is expanded. So, one thing you could try is to handling the RowsExpended and RowsCollapsed events in the DataboundGrid and set this dynamic childtable to be the datagrid''s datasource at that point. Attached is his form1.cs file with this change. If you expand the DataboundGrid and move teh current position in the DataboundGrid, the top right datagrid position will change too. > >Depending upon the exact behavior you want, you may have to explicitly handle position changed events in one or both type of grids, and then manually set the position in the other grids. > >Here is a form.cs file >http://www.syncfusion.com/Support/user/uploads/Form1_ba2ae191.cs > > >Please let me know if this helps. > >Thanks for choosing Syncfusion Products. >Best Regards, >Haneef > > >


AD Administrator Syncfusion Team May 9, 2006 01:27 PM UTC

Hi Yogi, Sorry for the inconvenience caused. Here is a link. http://www.syncfusion.com/Support/user/uploads/FormFile1_657914d8.zip Regards, Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon