I'm currently trying to use the GridView control with the Expression Dark Skin. I'm styling the whole control using the style manager. This works completely fine, however I've had to override the the filtering control to set a default option using the same technique as detailed in this thread:
http://www.telerik.com/community/forums/wpf/gridview/hide-and-filtering-options.aspx
When I do this the style of the filter control reverts back to the default Office Black theme. I thought about trying to set the style from code behind when I'm overriding the filter control, but I've no idea where to begin to do this. I've attached the relevant code below. Does anyone have any idea what the solution would be?
http://www.telerik.com/community/forums/wpf/gridview/hide-and-filtering-options.aspx
When I do this the style of the filter control reverts back to the default Office Black theme. I thought about trying to set the style from code behind when I'm overriding the filter control, but I've no idea where to begin to do this. I've attached the relevant code below. Does anyone have any idea what the solution would be?
public
class
CustomFilteringControl : Telerik.Windows.Controls.GridView.FilteringControl
{
public
override
void
Prepare(GridViewBoundColumnBase column)
{
base
.Prepare(column);
if
(column.DataType ==
typeof
(
string
))
// Set contains as default only for string data type of the gridview column
{
FilteringViewModel vm =
this
.DataContext
as
FilteringViewModel;
if
(vm !=
null
)
{
if
(!vm.Filter1.IsActive)
{
vm.Filter1.Operator = FilterOperator.Contains;
}
if
(!vm.Filter2.IsActive)
{
vm.Filter2.Operator = FilterOperator.Contains;
}
}
}
}
}