The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator 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.
ADAdministrator 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,
ADAdministrator 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]);
}