silverlight - SL4 - TextTrimming in DataGridRowGroupHeader -
i'm customizing datagridrowgroupheader in our project. works fine except can't text trim.
here's style:
<sdk:datagrid.rowgroupheaderstyles> <style targettype="sdk:datagridrowgroupheader"> <setter property="cursor" value="arrow" /> <setter property="istabstop" value="false" /> <setter property="background" value="transparent" /> <setter property="height" value="20"/> <setter property="margin" value="18,0,20,0"/> <setter property="isenabled" value="false"/> <setter property="template"> <setter.value> <controltemplate targettype="sdk:datagridrowgroupheader"> <grid name="root" margin="{templatebinding margin}" background="{templatebinding background}" horizontalalignment="stretch" > <visualstatemanager.visualstategroups> <visualstategroup x:name="currentstates"> <visualstate x:name="regular"/> <visualstate x:name="current"> <storyboard> <doubleanimation storyboard.targetname="focusvisual" storyboard.targetproperty="opacity" to="1" duration="0" /> </storyboard> </visualstate> </visualstategroup> </visualstatemanager.visualstategroups> <border borderbrush="yellow" borderthickness="1" visibility="visible"> <textblock x:name="txbgroupingname" margin="4,0,0,0" text="{binding name}" fontsize="13" texttrimming="wordellipsis" horizontalalignment="left" style="{staticresource orangebodytext}" /> </border> <rectangle name="focusvisual" stroke="{staticresource borderfocusbrush}" strokethickness="1" horizontalalignment="stretch" verticalalignment="stretch" ishittestvisible="false" opacity="0" /> </grid> </controltemplate> </setter.value> </setter> </style> </sdk:datagrid.rowgroupheaderstyles>
the text in textblock txbgroupingname won't trim , seems should fine.
thanks in advance!
i got answer yifung lin. rowgroupheader fixed width of row. it's intended horizontal scrollbar appears when datagrid content long, , rowgroupheaders can viewed way. it's when columns frozen problem appears.
thus there no solution really, reason why text won't trim dynamically. width can set on textblock force trimming, work better wrapping.
Comments
Post a Comment