Can you tell me how to hide the Match Case Button?
Thanks
Rich
5 Answers, 1 is accepted
A possible approach in your case is to alter the appearance of StringFilterEditor control and remove the MatchCase button from there. An implict style targeted at StringFilterEditor will be handled correspondingly by RadGridView's FilteringControl.
Vanya Pavlova
the Telerik team
In my case I am not using RadGridView, I am using RadDataFilter stand-alone where I create the definitions (see code below). In this situation can you show the code to hide the case button. I use this to create a where clause that I send to the server and since I not providing case capability I would like to hide the button.
Thanks
Rich
foreach (QueryColumnProperties colProp in queryTableProperties.QueryColumnProperties)
{
ItemPropertyDefinition itemDef = new ItemPropertyDefinition();
itemDef.DisplayName = colProp.ColumnName;
itemDef.PropertyType = Type.GetType(colProp.MetaColumn.SystemDataType);
itemDef.PropertyName = colProp.ColumnName;
radDataFilter.ItemPropertyDefinitions.Add(itemDef);
}
In this case you may predefine the appearance of RadDataFilter control and remove the match case button from there, however I am not quite sure how this works for you. You may refer to our online documentation where you may find detailed information about RadDataFilter's styling, follow this link.
Vanya Pavlova
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
<
ResourceDictionary
xmlns:filteringEditors
=
"clr-namespace:Telerik.Windows.Controls.Filtering.Editors;assembly=Telerik.Windows.Controls"
>
<
ControlTemplate
x:Key
=
"StringFilterEditorTemplate"
TargetType
=
"filteringEditors:StringFilterEditor"
>
<
Grid
MinWidth
=
"100"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
TextBox
Grid.Column
=
"0"
Text
=
"{Binding Text, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
telerik:StyleManager.Theme
=
"{StaticResource Theme}"
VerticalAlignment
=
"Stretch"
telerik:TextBoxBehavior.UpdateTextOnEnter
=
"True"
telerik:TextBoxBehavior.SelectAllOnGotFocus
=
"True"
/>
<!--
<
telerik:RadToggleButton
Grid.Column
=
"1"
Margin
=
"2,0,0,0"
IsChecked
=
"{Binding IsCaseSensitive, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
Visibility
=
"{Binding MatchCaseVisibility, RelativeSource={RelativeSource TemplatedParent}}"
telerik:StyleManager.Theme
=
"{StaticResource Theme}"
Content
=
"aA"
>
<
ToolTipService.ToolTip
>
<
TextBlock
telerik:LocalizationManager.ResourceKey
=
"GridViewFilterMatchCase"
/>
</
ToolTipService.ToolTip
>
</
telerik:RadToggleButton
>-->
</
Grid
>
</
ControlTemplate
>
<
Style
x:Key
=
"StringFilterEditorStyle"
TargetType
=
"filteringEditors:StringFilterEditor"
>
<
Setter
Property
=
"Template"
Value
=
"{StaticResource StringFilterEditorTemplate}"
/>
<
Setter
Property
=
"IsTabStop"
Value
=
"False"
/>
</
Style
>
<
Style
TargetType
=
"filteringEditors:StringFilterEditor"
BasedOn
=
"{StaticResource StringFilterEditorStyle}"
/>
</
ResourceDictionary
>
private void OnRadDataFilterEditorCreated(object sender, EditorCreatedEventArgs e)
{
var radDataFilter = (RadDataFilter)sender;
if (e.Editor is StringFilterEditor)
{
var editor = e.Editor as StringFilterEditor;
editor.MatchCaseVisibility = Visibility.Collapsed;
}
}
private
void
OnRadDataFilterEditorCreated(
object
sender, EditorCreatedEventArgs e)
{
if
(e.Editor
is
StringFilterEditor)
{
var editor = e.Editor
as
StringFilterEditor;
editor.MatchCaseVisibility = Visibility.Collapsed;
}
}