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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:





9957 Jan 19,2004 05:41 AM UTC Jan 19,2004 06:58 AM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On January 19, 2004 05:41 AM UTC

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon