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?
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?
The 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.