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
65
Bind same property multiple times
posted

Hi,

I'm having trouble with the XamDataGrid component when I try to bind multiple columns to the same property of an object.

Let's assume we have this class : 

public class Person{

   public string Name{get;set;}

}

And a simple XamDataGrid like this :

<igWPF:XamDataGrid>
 <igWPF:XamDataGrid.FieldLayoutSettings>
        <igWPF:FieldLayoutSettings AutoGenerateFields="False" />
    </igWPF:XamDataGrid.FieldLayoutSettings>

      <igWPF:XamDataGrid.FieldLayouts>
          <igWPF:FieldLayout>
              <igWPF:Field Name="Name" Label="Name" />
              <igWPF:Field Name="Name" Label="Name" />
          </igWPF:FieldLayout>
      </igWPF:XamDataGrid.FieldLayouts>

</igWPF:XamDataGrid>

When I execute this I have a System.NotSupportedException thrown, with the following message : 

Field named Name was not found in data source: Test.Person

Do you have any idea on how I could use twice the same column in the same XamDataGrid ? (Of course I'm not only showing twice the same columns for fun, I need it because one of them will use a converter).

Thank you for your help.

ps : Sorry for my English, I'm French.