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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Updating cells programmatically in GDBG!

Thread ID:

Created:

Updated:

Platform:

Replies:

37180 Nov 17,2005 04:12 AM UTC Nov 17,2005 05:40 PM UTC WinForms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On November 17, 2005 04:12 AM UTC

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 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.

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

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

CONFIRMATION

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.

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

;