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
265
Selection binding works for for a TemplateField "Name" but no other field
posted

Hi,

I am sure I am doing something wrong, but I am not sure where (I am new to WPF). Like in the example provided, I am using the following code to fill my tree, but the selection binding does not work. I see the data record correctly as my selected object but the set on the SelectedObj is never called if my templateField is bound to another property than Name, like I tried in the snippet below with FullName.

Works great if the property is Name...

Any help on how to achieve my display to be FullName and get the selecteed object to set would be greatly appreciated!

Thanks,

Maria

<igDP:XamTreeGrid x:Name="xtgTest" DataSource="{Binding ListOfCatObj}" SelectedDataItem="{Binding SelectedObj, Mode=TwoWay}" >

<igDP:XamTreeGrid.FieldLayoutSettings >

<igDP:FieldLayoutSettings AutoGenerateFields="False" RecordSelectorLocation="None" SelectionTypeRecord="Single" LabelLocation="Hidden"/>

</igDP:XamTreeGrid.FieldLayoutSettings>

<igDP:XamTreeGrid.FieldLayouts>

<igDP:FieldLayout>

<igDP:TemplateField Name="FullName" Width="*" DataType="{x:Type sys:String}">

<!--<igDP:TemplateField Name="Name" Width="*" DataType="{x:Type sys:String}"> THIS works!!!-->

<igDP:TemplateField.DisplayTemplate>

<DataTemplate>

<TextBlock Text="{igEditors:TemplateEditorValueBinding}" />

</DataTemplate>

</igDP:TemplateField.DisplayTemplate>

</igDP:TemplateField>

<igDP:Field Name="ListOfBaseObject" />

</igDP:FieldLayout>

</igDP:XamTreeGrid.FieldLayouts>

</igDP:XamTreeGrid>

Parents
No Data
Reply
  • 34830
    Offline posted

    Hello mariak,

    It is rather interesting that the SelectedDataItem property is working for you when your TemplateField's name is Name, but not FullName. I can't say at the moment why this would create a rift in behavior of the SelectedDataItem property, though. I believe your data item structure may help here, though. Would it be possible for you to please provide the code that you are using for your ViewModel and the data items that you are binding to the XamTreeGrid?

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

Children