forum

Home / DeveloperSection / Forums / Put the datagrid to more columns in WPF

Put the datagrid to more columns in WPF

Anonymous User 1839 18-Jul-2013
Hi developers!

I have a window in WPF and I have a datagrid and under datagrid I would like to have buttons.

I defined a parent grid like that:

 <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="50*" />
            <RowDefinition Height="50*" />        
        </Grid.RowDefinitions>

So on the first row I would like to have a datagrid that would be in all three columns and under grid I would like to have a button in each column.

If I do like that:

<DataGrid Grid.Row="0" Grid.Column="0"
<Button Grid.Row="1" Grid.Column="0"
<Button Grid.Row="1" Grid.Column="1" 
<Button Grid.Row="1" Grid.Column="2"

last two buttons are obviously on the right side from the datagrid. How to have all three buttons under the datagrid?

thanks in advance


wpf wpf 
Updated on 19-Jul-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By