We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Binding Issues

I have bee experimenting with the final example project supplied here : http://www.syncfusion.com/forums/123440/gridtreecontrol-notifying-changes-in-collection-and-dealing-with-data-object-of-selected-node

What I wanted to do was :

1) Have the tree initially empty until a button is clicked (button in bottom right corner) - this worked
2) When clicking the button the tree is loaded (by populating the bound viewmodel)  - this worked



3) However, when I click the button again I get the following. I have no idea where the extra columns have come from as they are defined in the XAML



The XAML is as below :

<syncfusion:GridTreeControl Name="treeGridFHIR"
                                    Grid.Column="0"
                                    Grid.Row="1"
                                    AllowDragColumns="True"
                                    AllowDrop="False"
                                    AllowSort="False"
                                    ChildPropertyName="Children"
                                    EnableHotRowMarker="False"
                                    EnableNodeSelection="True"
                                    ItemsSource="{Binding FHIRModelDetails}"
                                    NotifyPropertyChanges="True"
                                    VisualStyle="Metro"
                                    syncfusion:LayoutControl.SetMetroMode="True" ExpandGlyphType="PlusMinusLines" ExpandStateAtStartUp="AllNodesExpanded">

            <!--  GridTreeControl visible columns definition  -->
            <syncfusion:GridTreeControl.Columns>
                <syncfusion:GridTreeColumn Width="220" MappingName="LastName" />
                <syncfusion:GridTreeColumn Width="220" MappingName="MinMax" />
                <syncfusion:GridTreeColumn Width="220" MappingName="MyEyeColor" />
                    </syncfusion:GridTreeControl.Columns>
        </syncfusion:GridTreeControl>


3 Replies

SV Srinivasan Vasu Syncfusion Team March 28, 2016 12:19 PM UTC

Hi Richard,


Thanks for contacting Syncfusion support.


We regret to inform you that, we are unable to understand your requirement clearly. Could you please share more details and application logics regarding your requirement,  It will be helpful for us to analyze further. 


Please let us know if you require further assistance on this.
Regards,
Srinivasan


RI Richard March 28, 2016 03:42 PM UTC

Hi

Looking back I can see how my description may be hard to follow. I have attached an example project so you can see it for yourself.

Run the project, press the button in the bottom right corner to load the gridtree. It should load OK. Press the button again and the tree becomes corrupted, I don't know why?


Attachment: GridTree_Example_19972aa7.zip


SV Srinivasan Vasu Syncfusion Team March 29, 2016 12:23 PM UTC

Hi Richard,

We have analyzed your query with provided sample. When the Load Tree button clicked again, automatically the other Columns like ED, FirstName and Id are created as the GridTreeControl.AutoPopulateColumns is true and it is the default value. We have modified your sample by setting AutoPopulateColumns as false in “treeGridFHIR GridTreeControl.


AutoPopulateColumns:[ Default Value - True]

While creating the VisibleColumns, the GridTreeControl gets the metadata information (Property Name, DataTypes) about the collection and populate / assign the values based on the metadata information.

1.True

While using AutoPopulateColumns as True, GridTreeControl will get the information from bound underlyingcollection and populates VisibleColumns based on this.

2.False
While using AutoPopulateColumns as False, you have to bind each property in model to GridTreeColumn as per your requirement. 

Please download the modified sample from the below location,

Sample:http://www.syncfusion.com/downloads/support/forum/123533/ze/Modified_GridTree-1895240332

Regards,
Srinivasan




Loader.
Up arrow icon