Stopping user from selecting/unselecting rows in WPF DataGrid -
i have datagrid
on wpf page , want prevent user selecting cells. feature needed testing, don't want change in code.
after datagrid
filled, make sure of rows selected. want make sure user cannot select/unselect rows.
i tried setting isenabled = false
, ishittestvisible = "false"
both of these solutions disable scrollbars.
is there way this?
why not set ishittestvisible="false"
datagridrow
or datagridcell
objects only?
that's easy using implicit style in <datagrid.resources>
, , should disable hit-testing on rows or cells, should leave other areas of datagrid
functional, such headers or scrollbars
<datagrid.resources> <style targettype="{x:type datagridrow}"> <setter property="ishittestvisible" value="false" /> </style> </datagrid.resources>