DataGridCell BorderBrush not working - wpf

I tried to set DataGridCell BorderBrush, but it looks like there is some other setting, which also sets border between cells.
Current Style:
<Style x:Key="DataGridCellStyle1" TargetType="{x:Type DataGridCell}">
<Setter Property="BorderBrush" Value="Yellow"/>
</Style>
It looks like this:
I don't want that black border there. I want just the yellow border. Can someone please point me, where can I set the "black" border?

DataGrid has additional properties for grid lines
try set Yellow color for both
VerticalGridLinesBrush="Yellow"
HorizontalGridLinesBrush="Yellow"
or hide them
GridLinesVisibility="None"

Related

Need to change border color in grid using control template and data trigger in WPF

i am new in WPF. My project have one Grid Control that grid control border is Red color and I have a one button. when i click the button grid border color will be changed to green.
How can i changed to border color using control template with DataTemplate trigger. My Goal is border color will be change using template(don't change programmatically)
Screenshot will be attached.enter image description here
You can create a property called for example IsColorChanged and bind to your DataTrigger and when button is clicked set this boolean typed property to true on the code side then DataTrigger will set to background property of your border to the green.
<Grid>
<Border BorderThickness="2" CornerRadius="4">
<Border.Style>
<Style TargetType="{x:Type Border}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsColorChanged}" Value="True">
<Setter Property="Background" Value="Green"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
</Border>
</Grid>

Change Global Scrollbar Color with XAML

I'm trying to change the color of each part of the scrollbar for ScrollViewer, ListView, and RichTextBox using XAML.
This works as a global override for all Scrollbar Backgrounds.
<Style TargetType="{x:Type ScrollBar}">
<Setter Property="Background" Value="#FF191919"/>
<Setter Property="BorderBrush" Value="#FF191919"/>
</Style>
But I need a style color for each part.
ScrollBar
Thumb
RepeatButton
Using Style TargetType doesn't work for any other part.
The Thumb and RepeatButtons stay default white/gray.

WPF DataGrid Vertical Line Thickness

I've added a DataGrid to my WPF Window, and I've set the VerticalGridLinesBrush property in the XAML to show the vertical grid lines in the relevant colour. But I can't figure out how to increase width of the vertical grid lines, that are displayed in the DataGridRow.
Can someone please show me how to set the vertical grid line thickness in a WPF DataGrid?
set this properties
GridLinesVisibility="All" , VerticalGridLinesBrush="Red" and BorderThickness="1,1,5,0"
in dataGrid.
It seems there is no thickness setting for the GridLines... you can probably use DataGridCell properties instead.
<DataGrid GridLinesVisibility="Horizontal">
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0,0,3,0"/>
<Setter Property="BorderBrush" Value="Red"/>
</Style>
</DataGrid.CellStyle>

Removing DataGrid cell dotted border?

I want to remove the dotted border around Romance that can be seen in the above datagridcell. The border appears whenever i use the key board left-right navigation keys. How can i get rid of it ?
You have to clear out the FocusVisualStyle of the DataGridCells.
<DataGrid>
<DataGrid.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
</Style>
</DataGrid.CellStyle>
...

WPF- Changing Tooltip background to Transparent

I am attempting to make it so that when I hover over a button in my application, the "tooltip" displays my wording, along with a transparent background, instead of the white background.
I am merely trying to change the tooltip default settings to a transparent background..
I have looked and looked, but to no success.. anyone have any ideas?
Thanks.
<Style x:Key="{x:Type ToolTip}"
TargetType="{x:Type ToolTip}">
<Setter Property="Background"
Value="Transparent" />
</Style>
Place this in the resource dictionary of your view, or for your application.
And this is the final style which sets the tooltip background to transparent:
<Style TargetType="{x:Type ToolTip}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
</Style>
Note that you need to set also the BorderBrush to Transparent, not only the Background.
The class ToolTip has property Background. See http://msdn.microsoft.com/en-us//library/system.windows.controls.tooltip_members.aspx. You can set Background to Transparent.

Resources