---
title: "Put the datagrid to more columns  in WPF"  
description: "Put the datagrid to more columns  in WPF"  
author: "Anonymous User"  
published: 2013-07-18  
updated: 2013-07-19  
canonical: https://www.mindstick.com/forum/1324/put-the-datagrid-to-more-columns-in-wpf  
category: "wpf"  
tags: ["wpf"]  
reading_time: 1 minute  

---

# Put the datagrid to more columns  in WPF

Hi [developers](https://www.mindstick.com/articles/12875/blunders-you-must-avoid-while-hiring-java-developers-to-get-the-best-fulfilling-your-needs)!

I have a [window](https://www.mindstick.com/forum/161285/how-does-the-window-console-object-work-in-javascript) in [WPF](https://www.mindstick.com/forum/304/wpf) and I have a datagrid and under datagrid I would like to have buttons.

I defined a [parent](https://www.mindstick.com/blog/154/how-to-find-parent-of-control-in-wpf) [grid](https://www.mindstick.com/forum/369/how-can-i-add-a-column-name-to-my-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](https://www.mindstick.com/forum/1212/this-row-already-belongs-to-this-table) I would like to have a datagrid that would be in all three columns and under grid I would like to have a [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) 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](https://www.mindstick.com/articles/12766/check-whether-you-are-doing-digital-transformation-right-or-not) side from the datagrid. How to have all three buttons under the datagrid?

thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)

## Replies

### Reply by shreesh chandra shukla

HI!try this\

Add Grid.ColumnSpan="3":

<DataGrid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">


---

Original Source: https://www.mindstick.com/forum/1324/put-the-datagrid-to-more-columns-in-wpf

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
