Hello,
I'm working on a custom template of the RadGridView and I styled the SearchPanel to be only a text box part of a user control. The instant search/filtering works correctly, however, it seems that the highlighting doesn't.
While going through the source code, I saw that each column keeps a reference to the SearchPanel, in my case, it seems that this reference is null so the highlighting is not processed.
I simply declare the search panel in my user control and declare the user control as part of my template for RadGridView
<
grid:GridViewSearchPanel
Grid.Column
=
"1"
Style
=
"{StaticResource GridViewSearchPanelStyle}"
/>
With a style:
<
Style
x:Key
=
"GridViewSearchPanelStyle"
TargetType
=
"grid:GridViewSearchPanel"
>
<
Setter
Property
=
"Margin"
Value
=
"5 0 0 1"
/>
<
Setter
Property
=
"MaxHeight"
Value
=
"28"
/>
<
Setter
Property
=
"BorderThickness"
Value
=
"1"
/>
<
Setter
Property
=
"VerticalContentAlignment"
Value
=
"Center"
/>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Stretch"
/>
<
Setter
Property
=
"HorizontalAlignment"
Value
=
"Stretch"
/>
<
Setter
Property
=
"Background"
Value
=
"{StaticResource GridView_SearchPanelBackground}"
/>
<
Setter
Property
=
"BorderBrush"
Value
=
"{StaticResource GridView_SearchPanelOuterBorder}"
/>
<
Setter
Property
=
"SnapsToDevicePixels"
Value
=
"True"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
x:Name
=
"CustomSearch"
TargetType
=
"telerik:GridViewSearchPanel"
>
<
Grid
UseLayoutRounding
=
"True"
>
<
TextBox
x:Name
=
"PART_SearchAsYouTypeTextBox"
Text
=
"{Binding SearchText, Mode=TwoWay, Delay=100, UpdateSourceTrigger=PropertyChanged}"
MinWidth
=
"160"
MaxWidth
=
"200"
MaxHeight
=
"25"
Margin
=
"0 0 0 1"
VerticalContentAlignment
=
"Center"
telerik:TextBoxBehavior.UpdateTextOnEnter
=
"True"
>
<
TextBox.IsTabStop
>
<
Binding
RelativeSource
=
"{RelativeSource TemplatedParent}"
Path
=
"IsTabStop"
/>
</
TextBox.IsTabStop
>
</
TextBox
>
<
telerik:RadButton
x:Name
=
"ClearButton"
IsTabStop
=
"False"
Style
=
"{StaticResource ClearSearchValueButtonStyle}"
Command
=
"searchPanel:GridViewSearchPanelCommands.ClearSearchValue"
/>
</
Grid
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
So nothing fancy and for the most part this code is from Telerik's xaml files.
Am I missing something? Do I need to bind something somewhere in order for the highlighting feature to work?
Thank you in advance,
Bastian