This is a migrated thread and some comments may be shown as answers.

FilterRow Style

10 Answers 202 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Hubert
Top achievements
Rank 1
Hubert asked on 07 Dec 2012, 11:33 AM
Hello,

how can I change the Style of the FilterRow e.g. to change Background and remove Borders...
It would be great if you have some XAML CodeExamples for that!

regards

10 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 07 Dec 2012, 11:46 AM
Hi,

 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.

0
Hubert
Top achievements
Rank 1
answered on 07 Dec 2012, 11:59 AM
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>

0
Rossen Hristov
Telerik team
answered on 07 Dec 2012, 12:08 PM
Hi,

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.

0
Hubert
Top achievements
Rank 1
answered on 07 Dec 2012, 12:14 PM
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
0
Yoan
Telerik team
answered on 07 Dec 2012, 03:41 PM
Hi Hubert,

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.

Kind regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Hubert
Top achievements
Rank 1
answered on 10 Dec 2012, 02:56 PM
Hi,

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
0
Yoan
Telerik team
answered on 12 Dec 2012, 10:19 AM
Hello Hubert,


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.

Kind regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Maya
Telerik team
answered on 18 Dec 2012, 11:44 AM
Hi Hubert,

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. 

Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Hubert
Top achievements
Rank 1
answered on 30 Jan 2013, 10:49 AM
Hi,

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
0
Maya
Telerik team
answered on 31 Jan 2013, 08:08 AM
Hi Hubert,

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.

Tags
GridView
Asked by
Hubert
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Hubert
Top achievements
Rank 1
Rossen Hristov
Telerik team
Yoan
Telerik team
Maya
Telerik team
Share this question
or