Specifically i want to change the background color of the RadDatePicker (as well as the whole row) when i am changing the currently selected row with the up/down arrow keys.
To change the color of current row (highlighted) is achieved somewhat using Style.Triggers as per the following code:
But HOW TO MAKE THE TRIGGER AFFECT/SET THE STYLE OF THE RadDatePicker which is contained within the RadGridView? Is it do-able in XAML ?
Basically i want to make the color of a selected row (the whole row) the same, regardless of whether it contains default column types, or other controls within a column. The GridViewComboBoxColumn behaves as expected, and EndDate field in my example behaves as expected. The reason i am using a RadDatePicker is because i want to show the Calendar icon in cell view mode.
To change the color of current row (highlighted) is achieved somewhat using Style.Triggers as per the following code:
<
telerik:RadGridView
Name
=
"tlrkGridView"
IsFilteringAllowed
=
"False"
ShowGroupPanel
=
"False"
CanUserSortColumns
=
"False"
IsSynchronizedWithCurrentItem
=
"True"
ItemsSource
=
"{Binding Players}"
AutoGenerateColumns
=
"False"
>
<
telerik:RadGridView.RowStyle
>
<
Style
TargetType
=
"{x:Type telerik:GridViewRow}"
>
<
Style.Triggers
>
<
Trigger
Property
=
"IsSelected"
Value
=
"True"
>
<
Setter
Property
=
"Background"
Value
=
"AliceBlue"
></
Setter
>
</
Trigger
>
</
Style.Triggers
>
</
Style
>
</
telerik:RadGridView.RowStyle
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Name}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Number}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Country}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding StartDate}"
DataFormatString
=
"{} {0: d/MM/yyyy}"
Header
=
"Custom Header"
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
telerik:RadDatePicker
x:Name
=
"datePicker"
DateTimeWatermarkContent="<Select a date>" SelectedValue="{Binding StartDate, Mode=OneWay}" />
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
<
telerik:GridViewDataColumn.CellEditTemplate
>
<
DataTemplate
>
<
telerik:RadDatePicker
x:Name
=
"datePickerEdit"
DateTimeWatermarkContent="<Select a date>" SelectedValue="{Binding StartDate, Mode=TwoWay}" />
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellEditTemplate
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding EndDate}"
DataFormatString
=
"{} {0: d/MM/yyyy}"
/>
<
telerik:GridViewComboBoxColumn
DataMemberBinding
=
"{Binding ClubID}"
ItemsSource
=
"{Binding Clubs, Source={StaticResource MyViewModel}}"
SelectedValueMemberPath
=
"ID"
>
<
telerik:GridViewComboBoxColumn.ItemTemplate
>
<
DataTemplate
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
/>
<
ColumnDefinition
/>
<
ColumnDefinition
Width
=
"*"
></
ColumnDefinition
>
</
Grid.ColumnDefinitions
>
<
TextBlock
Text
=
"{Binding ID}"
/>
<
TextBlock
Text
=
" - "
Grid.Column
=
"1"
/>
<
TextBlock
Text
=
"{Binding Name}"
Grid.Column
=
"2"
/>
</
Grid
>
</
DataTemplate
>
</
telerik:GridViewComboBoxColumn.ItemTemplate
>
</
telerik:GridViewComboBoxColumn
>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
But HOW TO MAKE THE TRIGGER AFFECT/SET THE STYLE OF THE RadDatePicker which is contained within the RadGridView? Is it do-able in XAML ?
Basically i want to make the color of a selected row (the whole row) the same, regardless of whether it contains default column types, or other controls within a column. The GridViewComboBoxColumn behaves as expected, and EndDate field in my example behaves as expected. The reason i am using a RadDatePicker is because i want to show the Calendar icon in cell view mode.