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.

Parents
  • 16495
    Offline posted

    Hello Mattew,

     

    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.

    FieldsBinding.zip
Reply Children