How can we set border and background colour in the WPF grid control ,
i am creating rows and column dynamically and adding then to grid,can we set colour and border from the code behind?
home / developersection / forums / how to set row border and background color in wpf grid
How can we set border and background colour in the WPF grid control ,
i am creating rows and column dynamically and adding then to grid,can we set colour and border from the code behind?
Pravesh Singh
24-Sep-2013The Background color can just be set for the entire Grid by using the Background property:
<Grid Background="Red" />
Or if you want it set for individual cells, you need to add an element to the cell that has its Background property set.
As for Borders, a Grid only contains the ShowGridLines property, which can be used to show thin dotted lines that cannot be styled.