Ugrás a tartalomhoz

.NET Programming Technologies

Gergely Kovásznai, Csaba Biró

Eszterházy Károly College



Using GridSlitter control is possible during the program running to resize the rows and columns of the grid. It has to be placed between the rows and columns which we would like to resize. The ResizeDirection property can be used when we want to resize the rows or columns, the function of the ResizeBehaviour is to set the exact operation.

ResizeBehavior property:

  1. BasedOnAlignment

  2. CurrentAndNext

  3. PreviousAndCurrent

  4. PreviousAndNext

Example IV.7 Grid és GridSlitter

IV.8. Grid and GridSplitter

<Window x:Class="grid.MainWindow"



        Title="Grid" Height="300" Width="500">



            <RowDefinition />

            <RowDefinition Height="150"/>



            <ColumnDefinition Width="2*"/>

            <ColumnDefinition Width="auto"/>

            <ColumnDefinition Width="*"/>

            <ColumnDefinition Width="*"/>


        <Button Grid.RowSpan="2" Content="2 sor"/>

        <GridSplitter Grid.Row="0"






                      ResizeDirection="Columns" />

        <Button Grid.Column="2"


                Content="2 oszlop"/>

        <Button Grid.Row="1"


                Content="1,2" />

        <Button Grid.Row="1"


                Content="1,3" />