This is a migrated thread and some comments may be shown as answers.

How to Complete Cell Edit in Code?

1 Answer 77 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 22 Feb 2013, 06:05 PM
Quick question:  Trying this out to make a quick demo and noticed that if you're editing a cell and haven't hit enter to complete then that content doesn't get saved as part of an export.  It appears the control also doesn't auto complete the edit when it loses focus for say clicking a save button.

So how do I code it so when the control loses focus or some other event occurs that it completes the in progress cell edit and thus the whole thing will get saved?

Thanks

1 Answer, 1 is accepted

Sort by
0
Vesko
Telerik team
answered on 25 Feb 2013, 08:59 AM
Hello Mark,

Thanks for your question!

Internally we are using the concept of UI layers for building our presentation. UI layers provide an extensible approach to showing different parts of RadSpreadsheet’s sheet. For example, there are separate layers showing the cell borders, the selection, the fills, etc. We also have CellInput layer, which contains the logic for the user input. This layer have a public method ApplyChange() and its purpose is to complete the current change:

RadWorksheetEditor worksheetEditor = (RadWorksheetEditor)this.radSpreadsheet.ActiveSheetEditor;
 
CellInputUILayer cellInputUILayer = worksheetEditor.ActivePresenter.UILayers.GetByName(WorksheetPredefinedUILayers.CellInput) as CellInputUILayer;
if (cellInputUILayer != null)
{
    cellInputUILayer.ApplyChange();
}

We are going to extend our documentation with a topic about the UI layers architecture and API.

If you have any further questions, please do not hesitate to contact us again!

Greetings,
Vesko
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Spreadsheet
Asked by
Mark
Top achievements
Rank 1
Answers by
Vesko
Telerik team
Share this question
or