Restricting Tab Item Closing
The closure of TabItem can now be restricted by setting e.Cancel to true in OnCloseButtonClick delegate. āeā represents the event argument CloseTabEventArgs for OnCloseButtonClick event. The default value of e.Cancel is false.
The following code illustrates the same.
<syncfusion:TabControlExt OnCloseButtonClick="TabControlExt_OnCloseButtonClick">
<syncfusion:TabItemExt Header="Tab1"/>
<syncfusion:TabItemExt Header="Tab2"/>
<syncfusion:TabItemExt Header="Tab3"/>
</syncfusion:TabControlExt>
private void TabControlExt_OnCloseButtonClick(object sender, CloseTabEventArgs e)
{
if (e.TargetTabItem.Header.ToString() == "Tab1")
e.Cancel = true;
}
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page