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
30
Resizable Xamdatagrid
posted

Hi Team,

Currently, I am using xamdatagrid to show my data. I have two xamdatagrids on my WPF application, one below the other as shown in the image.

I want a feature where the user can resize the grid horizontally. When the user drags the top grid from the below section towards the up direction, it should shrink and the below grid should expand. Similarly, when the user drags the below grid down, the grid above it should expand.

Please let me know how can I achieve this.

Parents
No Data
Reply
  • 2420
    Offline posted

    Hi Vivek,

    Thank you for posting to Infragistics Community!

    I have been looking into your question and what I can suggest is placing the grids within a Grid Layout and utilizing the GridSplitter UI Element, which represents the control that redistributes space between columns or rows of a Grid control.

     The markup could look like this:

     

    <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="5" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <igWPF:XamDataGrid DataSource="{Binding Data}"
                               Grid.Row="0"
                               VerticalAlignment="Stretch">
                <igWPF:XamDataGrid.FieldLayoutSettings>
                    <igWPF:FieldLayoutSettings AutoGenerateFields="True" />
                </igWPF:XamDataGrid.FieldLayoutSettings>
            </igWPF:XamDataGrid>
            <GridSplitter Grid.Row="1"
                          HorizontalAlignment="Stretch"
                          VerticalAlignment="Stretch"
                          Background="#FF868686"
                          ShowsPreview="True"
                          Height="5" />
            <igWPF:XamDataGrid DataSource="{Binding Data}"
                               Grid.Row="2"
                               VerticalAlignment="Stretch">
                <igWPF:XamDataGrid.FieldLayoutSettings>
                    <igWPF:FieldLayoutSettings AutoGenerateFields="True" />
                </igWPF:XamDataGrid.FieldLayoutSettings>
            </igWPF:XamDataGrid>
        </Grid>

    and the result would correspond to your requirement. Additionally, what I can say is that this is more of a general layout question, since the XamDataGrids could be replaced with any WPF control and as such is not really related to Infragistics controls.

    Below you will find attached a small sample demonstrating this. If you require any assistance with the XamDataGrid’s usage, please, let me know.

    Best regards,
    Bozhidara Pachilova
    Associate Software Developer

     6153.XDGResizableLayout.zip

Children
No Data