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.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

9957 Jan 19,2004 12:41 AM Jan 19,2004 01:58 AM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 19, 2004 12:41 AM

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

Administrator [Syncfusion]
Replied On January 19, 2004 01:58 AM

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.

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.

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.

;