10 Answers, 1 is accepted
Have you tried to do this with Blend? Do you have any problems and/or questions?
Regards,Vlad
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Here is a CodeSnippet of the Style I use, but the Background, BorderBrush, BorderThickness doesnt apply! The Filterrow always looks the same no matter what I change in this Style! Any suggestions ? regards <telerik:FieldFilterControl x:Name="PART_FieldFilterControl" Column="{x:Null}" IsTabStop="False" Grid.Row="1" Visibility="{TemplateBinding FieldFilterControlVisibility}" Style="{DynamicResource FieldFilterControlStyle}"> <telerik:FieldFilterControl.Resources> <Style x:Key="FieldFilterControlStyle" TargetType="{x:Type telerik:FieldFilterControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type telerik:FieldFilterControl}"> <ContentControl x:Name="PART_FilterEditorContentControl" Grid.Column="0" BorderBrush="Transparent" BorderThickness="0" Background="OldLace" HorizontalContentAlignment="Stretch" IsEnabled="{Binding EditorIsEnabled}" VerticalContentAlignment="Stretch"> <ContentControl.Template> <ControlTemplate TargetType="ContentControl"> <ContentPresenter Height="20"> </ContentPresenter> </ControlTemplate> </ContentControl.Template> </ContentControl> </ControlTemplate> </Setter.Value> </Setter> </Style> </telerik:FieldFilterControl.Resources> </telerik:FieldFilterControl>
I assume that you want to style the actual editor which is determined, created and inserted at runtime. If the column is a string column, it is a StringFilterEditor, if it is DateTime it will be a RadDateTimePicker, for other types it will be a plain stock TextBox.
This editor created and will be inserted as the Content of the PART_FilterEditorContentControl.
You can attach to the FieldFilterEditorCreated event and apply the respective style to the respective editor.
Greetings,
Rossen Hristov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
if (e.Editor.GetType().Name.Equals("StringFilterEditor")) { ((StringFilterEditor)e.Editor).MatchCaseVisibility = System.Windows.Visibility.Collapsed; ((StringFilterEditor)e.Editor).Background = Brushes.OldLace; ((StringFilterEditor)e.Editor).BorderThickness = new Thickness(0); } Stil doesn't change the Background! Can you please give me a CodeSample how to change the Background of StringFilterEditor? regards
The StringFilterEditor control is created by a TextBox and a ToggleButton. So, you can find the TextBox which is in the StringFilterEditor control (using ChildrenOfType() ) and change its Background. Note that is not the recommended approach.
The recommended approach is to do this in XAML. You can extract the StringFilterEditor's template. Then you can change the TextBox's properties. For your convenience I have prepared a sample project. Please find it attached.
Yoan
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
your Solution worked fine thanks, but now I have a few other Problems!
1. I can´t get rid of the spaces between the FilterRow and the HeaderCell/GridRows
2. If i want to select Text in the FilterRow Textbox it begins to move the Column
3. I want the TabOrder of the FilterRow Textboxes to cycle is that possible?
regards
Thank you for reporting this problem.
I am happy to inform you that the second issue is now fixed. The fix will be included in our next internal build, which will be available next week. However, it turns out that we need more time to investigate the issue with the TabOrder. We will try to address it in some of our next versions.
Please, excuse us for the inconvenience caused. I have updated your Telerik points accordingly.
Yoan
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
We had a bug with the order of the header cells and tabbing through them does not follow the expected line. This has been resolved and the fix will be available in our nest internal build.
However, once you reach the last element in the header row, continuing tabbing will lead you to the next available element from the grid.
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
I have managed to change the background of the stringfiltereditor but which template do I have to edit for datatype INT?
And how do get the internal build where the Bug with the TabOrder has been fixed?
thanks in advance!
regards
The editor for numeric values is TextBox as well. So, if you want to change its background, you can just create style targeting its type:
<
Style
TargetType
=
"TextBox"
>
<
Setter
Property
=
"Background"
Value
=
"Red"
/>
</
Style
>
As for the fix, it has been already included in our internal builds, so if you download our latest one, it should be available.
Kind regards,
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.