C# WPF DataGrid.RowStyle set column style -


is possible affect style/behaviorto specified column in specified row in wpf c#?

right have this:

                    <datatrigger binding="{binding path=status}" value="2">                         <setter property="grid.column" value="0"/>                         <setter property="isenabled" value="false" />                     </datatrigger> 

the problem right is, entire row disabled. first column disabled in circumstances.

this column, disable:

            <datagridtemplatecolumn header="details" width="100">                 <datagridtemplatecolumn.celltemplate>                     <datatemplate>                         <button click="showdetails">details</button>                     </datatemplate>                 </datagridtemplatecolumn.celltemplate>             </datagridtemplatecolumn> 

this works (disabling 2nd column "y" if value of "x" 3):

    <datagrid itemssource="{binding items}" autogeneratecolumns="false">         <datagrid.columns>             <datagridtextcolumn header="x" binding="{binding x}"/>             <datagridtextcolumn header="y" binding="{binding y}">                 <datagridtextcolumn.cellstyle>                     <style targettype="datagridcell">                         <style.triggers>                             <datatrigger binding="{binding x}" value="3">                                 <setter property="isenabled" value="false"/>                             </datatrigger>                         </style.triggers>                     </style>                 </datagridtextcolumn.cellstyle>             </datagridtextcolumn>         </datagrid.columns>     </datagrid> 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -