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

GridDataBoundGrid + Hirachie View update

Hi, I've found a way to update a hirachical table in a grid. But every time I update the record using the bound data table, the viewstate of all rows of the grid are refreshed. I use the CurrencyManager to inform the grid over the changes in the bound data table. Sample: CurrencyManager cm = (CurrencyManager) _datagrid.BindingContext[contiTestdaten1, "Testdaten"]; cm.Refresh(); Is there a way to keep the viewstate? When I did not call the cm.Refresh() method, the grid did not know of any changes in the data table, and the + for the hirachic records are not displayed/browsable. Thanks in advance, Georg

1 Reply

AD Administrator Syncfusion Team November 14, 2003 09:24 AM UTC

These problems all go away using the new GridTable object in upcoming 2.0 release (which we are working hard on to get out...) In the current version, I do not think you need to call cm.Refresh to make the changes appear in the grid. I think you just need to get the grid to redraw the affected row somehow. Attached is a little sample. As nodes are expanded and collapsed, the code subscribes to the currency manager changed event for the particular currency manager of the child list for that node. Then in the handler, it just does a grid Refresh to force the whole grid to redraw. If you do not want the whole grid to redraw, then you would have to go to the trouble of mapping the changed item from the currency manager to a particular row in the grid, and then just refresh that particular row. This is doable, but does take some code as it requires recursion to handle this task. If you need to go to this trouble, we do have a sample showing how this would work. But it is somewhat simpler to refresh the whole grid, and depending upon the visible size of your grid and the frequency of updates, you may not require the more specific update code.

Live Chat Icon For mobile
Up arrow icon