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
1715
XamDatagrid column width
posted

hi,

i want to set width for colum in such a way that ,the width will be fixed while loading for the first time(say 100 or 200),after that user can resize column,

how can i achive this??

Regards,

Jafar VM

  • 715
    Verified Answer
    Offline posted

    Hi,

    you can use the width property of the Field element:

    <igDP:XamDataGrid.FieldSettings>
                    <igDP:FieldSettings AllowResize="True" />
    </igDP:XamDataGrid.FieldSettings>

    <igDP:XamDataGrid.FieldLayouts>
                    <igDP:FieldLayout>
                        <igDP:FieldLayout.Fields>
                            <igDP:Field Name="col1" Width="100">
                                <igDP:Field.Settings>
                                    <igDP:FieldSettings AllowEdit="False" />
                                </igDP:Field.Settings>
                            </igDP:Field>

                            <igDP:Field Name="col2" Label="COL2" Width="200">
                                <igDP:Field.Settings>
                                    <igDP:FieldSettings AllowGroupBy="False" />
                                </igDP:Field.Settings>
                            </igDP:Field>                 
                        
                    </igDP:FieldLayout>
                                    
    </igDP:XamDataGrid.FieldLayouts>