wpf - ContextMenu for DataGrid ColumnHeader is not showing after applying this style? -


if apply style wpf datagrid, context menu columnheader not showing. shows if remove style. what's wrong or missing in style?

<style x:key="defaultcolumnheader"        targettype="{x:type datagridcolumnheader}">   <setter property="verticalcontentalignment"           value="center" />   <setter property="template">     <setter.value>       <controltemplate targettype="{x:type datagridcolumnheader}">         <dg:datagridheaderborder x:name="datagridheaderborder"                                  margin="-1 0 0 0"                                  verticalalignment="top"                                  height="24"                                  isclickable="{templatebinding canusersort}"                                  ishovered="{templatebinding ismouseover}"                                  ispressed="{templatebinding ispressed}"                                  separatorbrush="{templatebinding separatorbrush}"                                  separatorvisibility="{templatebinding separatorvisibility}"                                  sortdirection="{templatebinding sortdirection}"                                  background="{templatebinding background}"                                  borderbrush="{templatebinding borderbrush}"                                  borderthickness="{templatebinding borderthickness}"                                  padding="{templatebinding padding}"                                  grid.columnspan="1">           <grid x:name="grid"                 width="auto"                 height="auto"                 rendertransformorigin="0.5,0.5"                 margin="-5 0 -5 0">             <grid.rendertransform>               <transformgroup>                 <scaletransform />                 <skewtransform />                 <rotatetransform />                 <translatetransform />               </transformgroup>             </grid.rendertransform>             <grid.columndefinitions>               <columndefinition width="auto" />               <columndefinition width="*" />               <columndefinition width="auto" />             </grid.columndefinitions>             <thumb x:name="part_leftheadergripper"                    grid.column="0"                    horizontalalignment="left"                    width="3"                    borderthickness="0"                    background="transparent"                    cursor="sizewe"                    margin="0"                    template="{staticresource thumbtemplate}" />             <contentpresenter x:name="contentpresenter"                               grid.column="1"                               margin="2 0"                               horizontalalignment="{templatebinding horizontalcontentalignment}"                               verticalalignment="{templatebinding verticalcontentalignment}"                               snapstodevicepixels="{templatebinding snapstodevicepixels}"                               contentstringformat="{templatebinding contentstringformat}"                               contenttemplate="{templatebinding contenttemplate}">               <contentpresenter.content>                 <binding relativesource="{relativesource templatedparent}"                          path="content" />               </contentpresenter.content>             </contentpresenter>             <thumb x:name="part_rightheadergripper"                    grid.column="2"                    horizontalalignment="right"                    width="3"                    borderthickness="0"                    background="transparent"                    cursor="sizewe"                    margin="0"                    template="{staticresource thumbtemplate}" />           </grid>         </dg:datagridheaderborder>       </controltemplate>     </setter.value>   </setter> </style> 


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -