Hi,
I bind an observable collection to my xamDataGrid. One of my properties is of type boolean so I have a xamCheckEditor for editing the value. Depending on other propertie's values, the boolean type is of no use, so I like to hide the xamCheckEditor in these cells. How can I accomplish this?
Any answer is appreciated.
Hello freyth,
Thank you for posting.
I have been looking into your requirements and have some questions about the functionality you are using.
Are you using a CheckBoxField, UnboundFields or TemplateFields for the Boolean property? Are you autogenerating the Fields of the XamDataGrid or you are creating them manually?
Having this information would help me further investigate this matter for you.
Looking forward to hearing from you.
I am using fieldlayouts for all of my properties.
<igDP:XamDataGrid.FieldLayouts > <igDP:FieldLayout Key="ParentLayout"> <igDP:FieldLayout.Fields> <igDP:Field Name="AnswerValueBool" Label="Selection" Width="Auto" /> <igDP:Field Name="DisplayName" Label="Question" Width="Auto" IsReadOnly="True"/> </igDP:FieldLayout.Fields> </igDP:XamDataGrid.FieldLayouts> </igDP:FieldLayout >
Thank you for the provided information.
I have been looking into it and have created a small sample application. In the sample application I have a simple XamDataGrid, in which resources I am creating a style for the XamCheckEditor. In this style there are two DataTriggers and in them I am binding for the property, that is displayed in the first field. Then I check what is the value of the property and according to this I am setting the Visibility property of the XamCheckEditor to Collapsed or Visible.
In order for that style to be applied only for the second Field I am setting a key for it. Then in the Loaded event of the grid I get the XamCheckEditor, using our Utilities class and assign the style to it.
Please do not hesitate to let me know if you have any further questions on this matter.
Hello Gergana,
Thats exactly the solution I was looking for.
Thank you very much.
Thank you for the feedback. I am glad I was able to help.