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
625
xamDataTree not displaying the displaymemberpath
posted

I am trying to use the xamDataTree control to display some very simple data. I have a class WizardStep which contains a string property Subtitle:

public class WizardStep {  public string Subtitle; }

I have setup the xamDataTree as follows:

<ig:XamDataTree Name="MyTree" Background="Transparent">
<ig:XamDataTree.GlobalNodeLayouts>
<ig:NodeLayout Key="WizardStepLayout" TargetTypeName="WizardStep" DisplayMemberPath="Subtitle"></ig:NodeLayout>
</ig:XamDataTree.GlobalNodeLayouts>
</ig:XamDataTree>

I set the ItemSource to a populated array of type WizardStep in code behind:

MyTree.ItemsSource = wizardSteps;

But nothing appears in the XamDataTree. Interestinlgy if I set the ItemSource as

MyTree.ItemsSource = wizardSteps.Select(x => x.Subtitle);

then the tree is populated.

Please advise.

Parents
No Data
Reply
  • 30945
    Verified Answer
    Offline posted

    Hello Matt,

     

    Thank you for you post. I have been looking into the behavior that you have described and the reason for it is that the Subtitle is a field. What I can suggest in order to avoid this behavior is changing the Subtitle to a property as follows:

     

        public class WizardStep

        {

            public string Subtitle { get; set; }

        }

     

     

    Please let me know if you need any further assistance on the matter.

     

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

Children
No Data