Hello,
I don't have a lot of experience working directly with WPF or XamDataGrid, so maybe this is just a simple syntax issue.
But I have a XamDataGrid where I specify the data source:
<dataPresenter:XamDataGrid x:Name="FileGrid" DataSource="{Binding FileList}">
Each column/field is a property of an item in the list (these are bound just fine).
<dataPresenter:Field Name="FileName"
<dataPresenter:Field Name="FileId"
<dataPresenter:Field Name="FileCondition"
Items on list:
public class SelectedFile { public string FileName { get; set; } public int FileId { get; set; } public string FileCondition { get; set; } public bool IsSelected { get; set; } public bool IsEnabled { get; set; } }
The issue is I want to bind the IsEnabled property of the fields to the property on the item. I'd expect something like below to work but it isn't.
<dataPresenter:Field Label="Select" Name="IsSelected" IsEnabled="{Binding Path=DataItem.IsEnabled}">
Thanks for any help.
Hello Matthew,
Thank you for your feedback. I am very glad that my suggestion was helpful for you. Please let me know if you require any further assistance on the matter.
Thank you! That worked fine. I used the cell binding approach as it was a little cleaner.
Hello Mattew,
I have been looking into your requirement further and it seems that in your scenario another available approach is to use CellBinding. You can use it to bind cell settings to data item properties using CellBindings collection property.
You can read more details from the following link:
http://help.infragistics.com/Help/Doc/WPF/2015.1/CLR4.0/html/xamDataGrid_Binding_Cell_Settings_Data_Item_Properties.html
I modified the last sample application to show you how you can implement this approach.
If you require any further assistance on the matter, please do not hesitate to ask.
Thank you for your post.
I have been looking into the code snippet that you have provided and what I can suggest is to create style for the editor you want in this scenario XamCheckEditor and set its IsEnabled property by using the same Path as in your snippet. I created short sample application based on your scenario to show you how you can implement this approach and achieve the functionality that you are looking for.
Please let me know if you require any further assistance on the matter.