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
190
Using xamGrid with AutoGenerate columns set to false not working
posted
I have a grid that I'm trying to create using the XamGrid control. Everything works fine except when I turn AutoGenerateColumns to false, it doesn't load at all. I've triple checked that my object property matches the field name exactly. It still has nothing. Any ideas? Here's my xaml.

<ig:XamGrid x:Name="test" ItemsSource="{Binding Path=MyList, IsAsync=True}" Height="Auto"  MinHeight="150" Width="Auto" MinWidth="500" AutoGenerateColumns="False" >
                    <ig:XamGrid.PagerSettings>
                        <ig:PagerSettings AllowPaging="Top" PageSize="500"/>
                    </ig:XamGrid.PagerSettings>
                    <ig:XamGrid.ColumnLayouts>
                        <ig:ColumnLayout Key="ObjectKey">
                            <ig:ColumnLayout.Columns>
                                <ig:TextColumn x:Name="fieldName" Key="Name" Width="Auto" HeaderText="Person Name"/>
                            </ig:ColumnLayout.Columns>
                        </ig:ColumnLayout>
                    </ig:XamGrid.ColumnLayouts>
                </ig:XamGrid>
  • 138253
    Verified Answer
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into it and I can suggest you define the Columns of the XamGrid like this:

    <ig:XamGrid.Columns>
        <ig:TextColumn x:Name="fieldName" Key="Name" Width="Auto" HeaderText="Person Name"/>
    </ig:XamGrid.Columns>
    

    If you have flat data, because the ColumnLayouts are used, when you have hierarchical data and every level of data, without the first one, is defined with ColumnLayout with Key set to the Property, which has the child collection. Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.