Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the back ground color of grid-column in wpf?

I have a wpf mvvm application. And have a GRID with multiple columns

whats best way to set the back ground color of grid-column in wpf?

like image 485
Relativity Avatar asked Jun 14 '11 16:06

Relativity


1 Answers

Create a rectangle and set its fill to the color of your choice.

Only having :

<Rectangle
Grid.Column="1"
Fill="#e8ebf1" />

works for me.

The Grid.RowSpan of previous answers is actually useless, and the LinearGradientBrush demonstrated is over-complicated for what is asked.

like image 57
Magellan Avatar answered Sep 27 '22 19:09

Magellan