Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to hide a BarEditItem's caption

$
0
0

This example shows how to hide a BarEditItem's caption even if the control is not empty.


In versions 2011 vol 2 and 2012 vol 1, this functionality can be implemented by overriding the {dxbt:BarEditItemThemeKeyExtension ResourceKey=Template} control template. In this template, bind the Visibility property of the "PART_Content" element to a custom property in the following manner:

[XAML]
<dxc:MeasurePixelSnapperContentControlx:Name="PART_Content"Visibility="{Binding Path=Link.(dxm:BarEditItemMode.IsCaptionVisible), ...}".../>

Alternatively, this functionality can be implemented by setting the BarItemLinkControl.ActualShowContentProperty property to False.

Starting with v2012 vol 2 we have changed templates of BarItemLinkControl and its descendants (see the BC1768 breaking change to get more information). In this version, the item's content can be hided by overriding the BarEditItemLinkControl.UpdateLayoutPanelShowContent method in the following manner:

[C#]
publicclassMyBarEditItemLinkControl:BarEditItemLinkControl{protectedoverridevoidUpdateLayoutPanelShowContent(){if(LayoutPanel!=null)LayoutPanel.ShowContent=((MyBarEditItemLink)Link).IsCaptionVisible;}}


To learn more on how to implement a similar functionality in Silverlight, refer to the T246748 example.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>