FilterRow Style

11 posts, 0 answers
  1. Hubert
    Hubert avatar
    13 posts
    Member since:
    Sep 2012

    Posted 07 Dec 2012 Link to this post

    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
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 07 Dec 2012 Link to this post

    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.

  3. Hubert
    Hubert avatar
    13 posts
    Member since:
    Sep 2012

    Posted 07 Dec 2012 Link to this post

    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>

  4. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 07 Dec 2012 Link to this post

    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.

  5. Hubert
    Hubert avatar
    13 posts
    Member since:
    Sep 2012

    Posted 07 Dec 2012 Link to this post

    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
  6. Yoan
    Admin
    Yoan avatar
    1182 posts

    Posted 07 Dec 2012 Link to this post

    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.

  7. Hubert
    Hubert avatar
    13 posts
    Member since:
    Sep 2012

    Posted 10 Dec 2012 Link to this post

    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
  8. Yoan
    Admin
    Yoan avatar
    1182 posts

    Posted 12 Dec 2012 Link to this post

    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.

  9. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 18 Dec 2012 Link to this post

    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.

  10. Hubert
    Hubert avatar
    13 posts
    Member since:
    Sep 2012

    Posted 30 Jan 2013 Link to this post

    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
  11. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 31 Jan 2013 Link to this post

    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.

Back to Top