How can I get a sheet name change event?

Hi,

Im using the WPF SfSpreadsheet and I need to run some code when the user changes a sheet name.

I can't find an event for this in the docs.

Thanks

1 Reply

EM Elakkiya Muthukumarasamy Syncfusion Team July 5, 2018 12:47 PM UTC

Hi Jeffrey Kesselman, 
 
Thanks for contacting syncfusion support. 
 
You can achieve the reported requirement by reflecting the ExternalTabControl in SfSpreadSheet using reflection and wire the AfterLableEdit event as like below code example in which the you can get the notification when sheet name is renamed in the SheetTab. And we will update the same in our UG documentation too.  
 
 
Code example[C#]: 
...  
TabControlExt ExcelTabControl; 
void spreadsheetControl_WorkbookLoaded(object sender, WorkbookLoadedEventArgs args) 
{                                                                                                                                                                                                       
if (ExcelTabControl != null) 
    ExcelTabControl.AfterLabelEdit -= ExcelTabControl_AfterLabelEdit; 
 
ExcelTabControl = spreadsheetControl.GetType().GetField("ExcelTabControl", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(spreadsheetControl) as TabControlExt; 
 
if (ExcelTabControl != null) 
    ExcelTabControl.AfterLabelEdit += ExcelTabControl_AfterLabelEdit; 
 
} 
 
private void ExcelTabControl_AfterLabelEdit(object sender, AfterLabelEditEventArgs e) 
{ 
    
} 
 
 
 
Please refer the sample link below, 
 
Regards, 
Elakkiya M. 


Loader.
Up arrow icon