wpf - Xamdatagrid IsReadOnly binding is not working -


xaml:

<igdp:field name="range" label="range (>=)" width="auto">                                         <igdp:field.settings>                                             <igdp:fieldsettings allowedit="true" editortype="{x:type igeditors:xamnumericeditor}" editastype="{x:type sys:double}">                                                 <igdp:fieldsettings.editorstyle>                                                     <style targettype="{x:type igeditors:xamnumericeditor}">                                                         <setter property="isreadonly" value="{binding dataitem.isreadonly}" />                                                     </style>                                                 </igdp:fieldsettings.editorstyle>                                             </igdp:fieldsettings>                                         </igdp:field.settings>                                     </igdp:field> 

view model:

public bool isreadonly     {         { return false; }     } 

i want format cell based on condition eg when retrieve false db user cannot edit data in cell , vice versa. have tried bind using allowedit, it's not working. above method in view model test example. hope can provide solution.

your problem not clear::::

if binding isreadonly property inside object not vm binding works fine.

but if bind vm property have this:

<style targettype="{x:type igeditors:xamnumericeditor}">       <setter property="isreadonly" value="{binding datacontext.isreadonly,relativesource={relativesource ancestortype=igdp:xamdatagrid}" /> </style> 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

html - Outlook 2010 Anchor (url/address/link) -