Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
440
WinGrid Select Text Property
posted

I have a wingrid which populates X rows and Y Columns. Now the User Select' A Range of Cells(UltraGrid1.Selected.Cells) and Applys a Value to these cells. What should happen is the value entered by the user should append to the Selected Cell Value(s).

 

 

 

 

foreach

 

(UltraGridCell _cell in ugGrid.Selected.Cells)

{

 

 

ugGrid.Rows[_cell.Row.Index].Cells[_cell.Column].SelText=_cell.Value + Environment.NewLine + "Text to be Appended to Cell";

}

Now I tried  ugGrid.PerformAction(UltraGridAction.EnterEditMode); but this deselects all the cells.

I tried to capture the Selected Cells in a collection(SelectedCellCollection) but as soon as i call ugGrid.PerformAction(UltraGridAction.EnterEditMode) the collection is rendered empty.

I tried to Set the Value but it is not displayed in the grid.

Error:

Selection related properties (SelText, SelStart and SelLength) are not supported while the cell is not in edit mode.

 

  • 469350
    Suggested Answer
    Offline posted

    If you want to change the value of a cell, simply use the Value property or the cell.

    You do not need to enter edit mode on the cell - entering edit mode is so that the user can edit the value. You don't need to do that when you are updating values in code, and entering edit mode will clear all selection i the grid.