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

Updating cells programmatically in GDBG!

Thread ID:





37180 Nov 16,2005 11:12 PM Nov 17,2005 12:40 PM Windows Forms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On November 16, 2005 11:12 PM

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

Administrator [Syncfusion]
Replied On November 17, 2005 04:33 AM

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.

Administrator [Syncfusion]
Replied On November 17, 2005 12:08 PM

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,

Administrator [Syncfusion]
Replied On November 17, 2005 12:40 PM

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]); }


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.

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.