End edit of current cell

2 posts, 0 answers
  1. Fernando
    Fernando avatar
    5 posts
    Member since:
    May 2014

    Posted 22 Oct 2014 Link to this post


    I have an application with a radspreadsheet and a button. When i click the button with the cell in edit mode (i have the cursor of the mouse inside it) i cant get the new value of the cell. Is there any way to end the edit mode of the current cell?.

    When i write on C2 "1" ,exit the cell and click on save i get "1".

    Then, when i write on C2 "2" , and click on save without exit the cell i still get "1" instead of "2".


  2. Anna
    Anna avatar
    114 posts

    Posted 24 Oct 2014 Link to this post


    In order to end the edit mode of the cell, you can use the ActiveCellMode property of the Selection class.

    RadWorksheetEditor editor = this.radSpreadsheet.ActiveWorksheetEditor;
    editor.Selection.ActiveCellMode = ActiveCellMode.Display;

    This, however, will not confirm the currently entered value in the cell editor. You would have to get the text from the cell editor and set it to the current cell. Then your code will look similar to this:

    RadWorksheetEditor editor = this.radSpreadsheet.ActiveWorksheetEditor;
    WorksheetUILayerBase inputLayer = editor.ActivePresenter.UILayers.GetByName(WorksheetPredefinedUILayers.CellInput);
    string currentInput = (inputLayer as CellInputUILayer).CellEditor.Text;
    editor.Selection.ActiveCellMode = ActiveCellMode.Display;

    I hope this helps.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top