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
320
Auto size column
posted

Hello,

I'm looking to to find a way to auto arrange column width but in another way that I read here (http://forums.infragistics.com/forums/p/1077/11263.aspx#11263) so I make a new post.

I would like to auto arrange column with to have the column to be in the all size of the grid

Here is my code :
    <Grid Name="myGrid">

        <igDP:XamDataGrid   MouseDoubleClick="CursusList_MouseDoubleClick"
                            Name="CursusList"
                            Margin="0,0,0,8"
                            Theme="Office2k7Silver"
                            GroupByAreaLocation="None"
                            Foreground="Black"
                            HorizontalAlignment="Stretch"
                            RecordContainerGenerationMode="PreLoad"
                            RecordLoadMode="PreloadRecords"
                            CellContainerGenerationMode="PreLoad">

            <igDP:XamDataGrid.FieldLayoutSettings>
                <igDP:FieldLayoutSettings AutoGenerateFields="False"/>
            </igDP:XamDataGrid.FieldLayoutSettings>

            <igDP:XamDataGrid.FieldLayouts>

                <igDP:FieldLayout>
                    <igDP:FieldLayout.FieldSettings>
                        <igDP:FieldSettings CellClickAction="SelectRecord" AllowEdit="False" />
                    </igDP:FieldLayout.FieldSettings>

                    <igDP:FieldLayout.Fields>

                        <igDP:Field Name="Reference" Label="Référence">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings CellClickAction="SelectRecord" AllowEdit="False" CellMinWidth="100"
                          CellMaxWidth="300" CellWidth="100" />
                            </igDP:Field.Settings>
                        </igDP:Field>

                        <igDP:Field Name="NameFrench" Label="Nom">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" CellMinWidth="100"
                          CellMaxWidth="300" CellWidth="200" />
                            </igDP:Field.Settings>
                        </igDP:Field>

                        <igDP:Field Name="Price" Label="Prix">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" CellMinWidth="100"
                          CellMaxWidth="300" CellWidth="200" EditorType="{x:Type igEditors:XamCurrencyEditor}">
                                    <igDP:FieldSettings.EditorStyle>
                                        <Style TargetType="{x:Type igEditors:XamCurrencyEditor}">
                                            <Setter Property="Mask" Value="nnn nnn.nn €"/>
                                        </Style>
                                    </igDP:FieldSettings.EditorStyle>
                                </igDP:FieldSettings>
                            </igDP:Field.Settings>
                        </igDP:Field>

                    </igDP:FieldLayout.Fields>

                </igDP:FieldLayout>

            </igDP:XamDataGrid.FieldLayouts>

        </igDP:XamDataGrid>
    </Grid>

 Can someone help m ?

  • 138253
    Offline posted

    Hello achatEzos,

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

    If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.

  • 138253
    Offline posted

    Hello achatEzos,

    Thank you for your post. I have been looking through it and I suggest you set AutoFitMode of the FieldLayoutSettings of your XamDataGrid to True. By doing this all the fields in the XamDataGrid will spread equally across the width of the XamDataGrid.

    Please note, we are making efforts to ensure all posts are addressed by an Infragistics expert. We believe that the other community members could benefit from this thread as well.

    Feel free to write me if you need further assistance.