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

Updating cells programmatically in GDBG!

Hi , I am new to GDBG and c#. I am using GDBG in a hierarchical view. My child rows are editable. I have question regarding updating the cell values programmatically. Whenever user modify a column 3rd on a child row I need to calculate almost every cell on the same row. Which event should I use? Should I set the values in datasource or should I set the values in grid cells. I want to keep my grid and datasource in sync so that values can be saved in DB. Please suggest the optimal way bin terms of performance. It should be fast. How do I handle refreshing of row? Thanks, psaxena

3 Replies

AD Administrator Syncfusion Team November 17, 2005 09:33 AM UTC

Try using the CurrentCellAcceptedChanges event. There you can get the string that the user typed using grid.CurrentCell.Renderer.ControlText. You can get the row/column from grid.CurrentCell.RowIndex/ColIndex. This event is raised as your user leaves a modified grid cell.


AD Administrator Syncfusion Team November 17, 2005 05:08 PM UTC

Thanks, Upon change in a cell value, Should I set the values in datasource (datatable) for other cells in SAME ROW or should I set the values in grid cells? Values in other cells will be changed based on lots of calculation. If your answer is datasource, then could you please tell how do i get current data row in datatable/dataview at child row? If there is sample/few line of code that would be great. Your help would be greatly appreciated! Regards,


AD Administrator Syncfusion Team November 17, 2005 05:40 PM UTC

It is probably easiest to use the datatable directly. To get at the current DataRowView from the child DataTable, try using code like: GridBoundRecordState state = grid.Binder.GetRecordStateAtRowIndex(grid.CurrentCell.RowIndex); if(state.LevelIndex == 1) //first child table { DataRowView drv = state.Table[state.Position] as DataRowView; Console.WriteLine(drv[0]); }

Loader.
Live Chat Icon For mobile
Up arrow icon