I'm using a GridView and would like to show a focus indicator for the entire row rather than a single cell. Here's a sample of what I've tried:
XAML:
Code Behind:
I'd like to get a dotted-line focus indicator around the entire row (excluding the row header), similar to an item in a list box. I would have thought setting SelectionUnit="FullRow" would cause that to happen, but I still see a focus rectangle around the cell that is focused. If there's a different control that would provide this along with columns, then I'm open to that too.
XAML:
<
Window
x:Class
=
"RadGridViewRowFocus.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
>
<
telerik:RadGridView
ItemsSource
=
"{Binding Items}"
SelectionUnit
=
"FullRow"
IsReadOnly
=
"True"
/>
</
Grid
>
</
Window
>
Code Behind:
namespace
RadGridViewRowFocus
{
using
System.Collections.ObjectModel;
using
System.Windows;
public
partial
class
MainWindow : Window
{
public
MainWindow()
{
InitializeComponent();
DataContext =
this
;
Items =
new
ObservableCollection<SampleData>
{
new
SampleData { Field1 =
"Item 1"
, Field2 =
"Item 1, Field 2"
},
new
SampleData { Field1 =
"Item 2"
, Field2 =
"Item 2, Field 2"
},
new
SampleData { Field1 =
"Item 3"
, Field2 =
"Item 3, Field 2"
},
new
SampleData { Field1 =
"Item 4"
, Field2 =
"Item 4, Field 2"
}
};
}
public
ObservableCollection<SampleData> Items {
get
;
set
; }
}
public
class
SampleData
{
public
string
Field1 {
get
;
set
; }
public
string
Field2 {
get
;
set
; }
}
}
I'd like to get a dotted-line focus indicator around the entire row (excluding the row header), similar to an item in a list box. I would have thought setting SelectionUnit="FullRow" would cause that to happen, but I still see a focus rectangle around the cell that is focused. If there's a different control that would provide this along with columns, then I'm open to that too.