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.
To customize input into the current cell I use something like that:
private void gridDataBoundGridBills_CurrentCellChanged(
object sender, System.EventArgs e)
{
GridDataBoundGrid grid = sender as GridDataBoundGrid;
int rowIdx = grid.CurrentCell.RowIndex;
int colIdx = grid.CurrentCell.ColIndex;
GridStyleInfo style = grid.Model[rowIdx, colIdx];
switch(colIdx)
{
case 3:
grid.CellRenderers[style.CellType].ControlText
= textBoxPartnerCode.Text;
grid.Refresh();
break;
......
}
}
Works all right as long as I stick to the current cell. But I also need to change adjacent cells. Tried to fiddle with
GridStyleInfo style = grid.Model[rowIdx, colIdx];
statement changing colIdx, but to no avail. What can I do?
Grateful in advance, Alexey
ADAdministrator Syncfusion Team January 19, 2004 06:58 AM UTC
You only need to work through the renderer when the cell is the currentcell. If the cell is not the currentcell, then you can try setting
grid.Model[rowIdx, colIdx].Text = "SomeText";
On potential problem may occur if the current row is not already being edited. In this case, you should call grid.Binder.BeginEdit() for a GridDataBoundGrid before you set the value. But since the currentcellchanged is what triggers this code, I would not think that this would be a problem in your case.