none
Changing margin of grid RRS feed

  • Question

  • I am having negative margins for the grid, i want to change that to positive. The last grid is by default trying to stick the right side of the last grid2 . I tried to move that to left. It didn't work.

    <DockPanel>

    <Grid1></Grid1>

    <Grid2></Grid2> <Grid DockPanel.Dock="Bottom" Margin="-980,416,-32,-80"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Button Width="86" Height="32" Command="{Binding SaveCommand}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="422,10,0,10" > <AccessText Text="_Save"/> </Button> <Button Width="92" Height="32" Command="{Binding CancelCommand}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,10,294,10" Grid.Column="1"> <AccessText Text="_Close"/> </Button> </Grid> </DockPanel>




    • Edited by wpf_xam1 Wednesday, October 14, 2015 9:44 PM
    Wednesday, October 14, 2015 9:06 PM

Answers

  • I have declared this grid before the first grid and used dockpanel.dock=bottom, increased the dockpanel size. That solved the issue.
    • Marked as answer by wpf_xam1 Wednesday, October 14, 2015 10:13 PM
    Wednesday, October 14, 2015 10:13 PM