DataGrid.VerticalGridLinesBrush Property
Silverlight
Gets or sets the Brush that is used to paint grid lines separating columns.
Namespace: System.Windows.Controls
Assembly: System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)
<sdk:DataGrid> <sdk:DataGrid.VerticalGridLinesBrush> singleBrush </sdk:DataGrid.VerticalGridLinesBrush> </sdk:DataGrid>
<sdk:DataGrid VerticalGridLinesBrush="colorString"/>
XAML Values
Property Value
Type: System.Windows.Media.BrushThe brush that is used to paint vertical grid lines. The default is a SolidColorBrush with a Color value of opaque grey (ARGB value #FFDFE3E6).
Dependency property identifier field: VerticalGridlinesBrushProperty()
This property has no effect if the GridLinesVisibility property is set to Horizontal or None.
The following code example demonstrates how to set VerticalGridLinesBrush property in code. This example is part of a larger example available in the Walkthrough: Customizing the DataGrid Control Using Properties topic.
private void cbCustomGridLineVert_Changed(object sender, RoutedEventArgs e) { CheckBox cb = sender as CheckBox; if (this.dataGrid1 != null) { if (cb.IsChecked == true) this.dataGrid1.VerticalGridLinesBrush = new SolidColorBrush(Colors.Blue); else this.dataGrid1.VerticalGridLinesBrush = new SolidColorBrush(Color.FromArgb(255, 223, 227, 230)); } }
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.