To hide the tabbar in spreadsheet control, you could implement the custom SfSpreadsheet control and override the OnApplyTemplate method to make the changes in TabControlExt. Please refer the following code example and the sample.
C#
public class CustomSfSpreadSheet : SfSpreadsheet
{
public CustomSfSpreadSheet()
{ }
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
try
{
var child = this.GetVisualChild(0);
var grid = child as Grid;
if (grid != null)
{
var childGrid = grid.Children[2] as Grid;
if (childGrid != null)
{
var tabControl = childGrid.Children[2] as TabControlExt;
if (tabControl != null)
{
tabControl.Loaded += TabControl_Loaded;
}
}
}
}
catch (Exception ex)
{
}
}
private void TabControl_Loaded(object sender, RoutedEventArgs e)
{
var tabControl = sender as TabControlExt;
HeaderPanel panel = VisualUtils.FindDescendant(tabControl, typeof(HeaderPanel)) as HeaderPanel;
if (panel != null)
{
panel.Visibility = Visibility.Collapsed;
}
}
} |