Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4341
Set the XamDataGrid as readonly
posted

Hi Support,

 

Just wanted to know, is there is any property to set the XamDataGrid as readonly. We are currently using 12.1.20121.1010 version of XamDataGrid. We want to set  the XamDataGrid as readonly, the grid access will be conditional and depending on some condition we want to set the XamDatagrid access. For this we tried setting triggers, however the trigger didn’t apply. Is there any way we can achieve make the grid as readonly through the trigger. We had also tried setting the "AllowEdit" property to false,  but found that setting the "AllowEdit" cannot be achieved using Triggers. Since we have data grids through the our application, we want to create a generic style which can be applied on all the data grids. Also the data grids have columns of data type such as boolean, numeric, datetime etc., so the style create should support all these data types as well.

 

Further, we have created a sample application which will demonstrate our requirement. The sample application UI has two menus "Group 1"  and "Group 2". The Group 1 has XamDataGrid which we want to make it read-only.

 

Basically we want to make a generic style to set the XamDataGrid as readonly.

SecurityAccessDemo.zip
  • 138253
    Offline posted

    Hello,

     

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter. 

  • 138253
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into it and the sample you have attached and I modified it, so the AllowEdit Property of the XamDataGrid is now bound. Since the FieldSettings is not a visual element, it is not part of the visual tree and it cannot be set trough the DataContext. I added a StaticResource to which I bound the AllowEdit. This resource could be an instance of your ViewModel and you can control the Property via the ViewModel. Please let me know if this helps you or you need further assistance on this matter.

       

    Looking forward for your reply.

    SecurityAccessDemoModified.zip