Show close button on tabitem when using custom template

<Setter Property="Template">
        <Setter.Value>
              <ControlTemplate TargetType="{x:Type sf:TabItemExt}">
                    <Grid>
                        <Grid>
                            <Border
                             Padding="{TemplateBinding Padding}"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="5" />
                       </Grid>
                       <Border
Padding="{TemplateBinding Padding}"
BorderThickness="{TemplateBinding BorderThickness}">
                            <ContentPresenter
                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                            ContentSource="Header" />
                                    </Border>


                                </Grid>





                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>



Hi, i need a little help regarding TabControlExt, i am using the above template for tabitem but the close button is not shown, How? Even though i have enabled the CloseButtonType="Both".


1 Reply

GT Gokul Thanudhas Syncfusion Team June 17, 2022 04:36 PM UTC

Hi Fahad,


We have placed the close button for tabitem in the template of tabitemext. Since you have overridden this template the close button is not visible. Please refer to the attached text file from the attached file for your reference.


Regards,

Gokul T.


Attachment: TabItem_f8923185.zip

Loader.
Up arrow icon