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

How to change text in a cell which is not current (different column of the same row)

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

1 Reply

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

Live Chat Icon For mobile
Up arrow icon