Hi Team,
i have problem while resizing the window. I have a window inside that i have a grid inside that im using a user control. when im resizing the window the user control content tables and buttons on xamdatagrid are not resizing automatically.
I tried with the below code and it is not working.
1) This is in the window
<window>
<Grid> <Views:InstrumentPickerView x:Name="InstrumentPicker"/> </Grid></Window>
2) This is in the user control
<StackPanel>
<StackPanel Orientation="Horizontal"> <igDP:XamDataGrid Theme="Aero" x:Name="XamDataPresenter1" Height="160" DataSource="{Binding user, Mode=OneWay}" Grid.Row="0" Margin="5" Grid.Column="1" GroupByAreaLocation="None" ActiveDataItem="{Binding Selecteuser}">
</StackPanel>
is there anything im missing here.
Hello Ram,
Thank you for contacting Infragistics!
First you are setting a fixed height on the grid, so not matter what happens to the container of the grid the grid height will remain the same unless changed in code. Next because you have the grid in a stack panel with orientation set to horizontal and inside another stack pannel the width of the grid will only take up the space required for its columns and not anymore.
Hi Mike,
Thanks for the reply.
I made some modifications in my code. please have a look.
main window.
<Window HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Views:InstrumentPickerView x:Name="car"/>
</Grid>
</Window>
user control
<Grid > <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"></ColumnDefinition> <ColumnDefinition Width="2*"></ColumnDefinition> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> </Grid.RowDefinitions> <igDP:XamDataGrid Theme="Aero" x:Name="XamDataPresenter1" Height="166" DataSource="{Binding user, Mode=OneWay}" Grid.Row="0" Margin="5" Width="auto" Grid.Column="1" GroupByAreaLocation="None" ActiveDataItem="{Binding Selecteduser}"> <igDP:XamDataGrid.InputBindings> <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding OkCommand}" /> </igDP:XamDataGrid.InputBindings> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="True" SelectionTypeCell="Default" AllowFieldMoving="WithinLogicalRow" SelectionTypeField="Single" SelectionTypeRecord="ExtendedAutoDrag"/> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldSettings > <igDP:FieldSettings Width="Auto" CellClickAction="SelectRecord" AllowEdit="False" /> </igDP:XamDataGrid.FieldSettings> </igDP:XamDataGrid>
and in the grid i have two button which are placed inside a stack panel resizes according to the main window.
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" Width="auto" HorizontalAlignment="Right" Margin="5"> <Button Content="OK" IsEnabled="{Binding EnableOk}" Command="{Binding OkCommand}" MinWidth="70" MinHeight="25" /> <Button Content="Cancel" Command="{Binding CancelCommand}" Margin="5,0,5,0" MinWidth="70" MinHeight="25"/> </StackPanel>
i want to resize the grid table content along with the main window.