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
60
Field Binding Properties
posted

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.