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
50
AutoGenerateFields="False" not working
posted

Hi!

This maybe a misunderstanding by a newbie, but I thought with setting AutoGenerateFields="False" only fields would show up I explicity defined.  However in the example below I also get a column "email".

Am I missing the point here? 

        <igDP:XamDataGrid x:Name="XamDataGrid1" BindToSampleData="true" >

            <igDP:XamDataGrid.FieldLayoutSettings>
                <igDP:FieldLayoutSettings AutoGenerateFields="False" />
            </igDP:XamDataGrid.FieldLayoutSettings>
            <igDP:XamDataGrid.FieldLayouts>
                <igDP:FieldLayout>
                    <igDP:FieldLayout.Fields>
                        <igDP:Field Name="name" Label="f1" />
                        <igDP:Field Name="department" Label="f2" />
                        <igDP:Field Name="salary" Label="f3" />
                    </igDP:FieldLayout.Fields>
                </igDP:FieldLayout>
            </igDP:XamDataGrid.FieldLayouts>

        </igDP:XamDataGrid>

Parents
No Data
Reply
  • 4850
    Offline posted

    Actually we special case it when BindToSampleData is set to True to always auto generate fields. The reason for this is because this property was intended for use mainly at design time to allow you to see what the grid would look like with some random data in it. If you were working on a app where the AutoGenerateFields was set to false then you wouldn't see anything and BindToSampleData would be useless.

Children