Hi James,
Please find the below details for asked queries,
|
S.No |
Query
|
Comments |
|
1 |
what event is raised when I select a cell and then press the delete key to delete its contents?
|
You can achieve this requirement by invoking the KeyDown event of the spreadsheetGrid and check the condition like whether the delete key is pressed or not. Please find the below code sample for your reference.
|
private void spreadsheet_WorkbookLoaded(object sender, WorkbookLoadedEventArgs args)
{
spreadsheet.ActiveGrid.KeyDown += ActiveGrid_KeyDown;
}
private void ActiveGrid_KeyDown(object sender, KeyEventArgs e)
{
if(e.Key == Key.Delete)
{
MessageBox.Show("Pressed Delete key");
}
}
|
|
|
2 |
Is there any way to change the edit mode on SfSpreadsheet so that the grid is edited when the cell is clicked rather than double clicked?
|
You can achieve this requirement by invoking the current cell BeginEdit method at the CellClick event as in the below code sample.
|
spreadsheet.ActiveGrid.CellClick += ActiveGrid_CellClick;
private void ActiveGrid_CellClick(object sender, GridCellClickEventArgs e)
{
//Enter into edit mode at single click based on the below condition.
if (spreadsheet.ActiveGrid.CurrentCell.RowIndex == 4)
spreadsheet.ActiveGrid.CurrentCell.BeginEdit(true);
}
|
|
Regards,
Thirumurugan