We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

style FilterRow in SfDataGrid

Hi!
How can I change the FilterRow (in SfDataGrid) style?

Regards,
Vitalii

9 Replies

JG Jai Ganesh S Syncfusion Team April 28, 2016 10:40 AM UTC

Hi Vitalii, 
 
You can change the FilterRow style by wring the style for FilterRowControl like below, 
 
Code Example: 
 
<Window.Resources> 
    <Style TargetType="Syncfusion:FilterRowControl"> 
        <Setter Property="Background" Value="LightBlue"/> 
    </Style> 
</Window.Resources> 
 
 
Regards, 
Jai Ganesh S 



VI vitalii April 28, 2016 11:11 AM UTC

Hi Jai,

Thanks for your reply.

How can I increase the height FilterRow?

This code not worked:
<Style TargetType="syncfusion:FilterRowControl"> 
        <Setter Property="Height" Value="100"/>
</Style>
As I understand, it is necessary to increase the height for FilterRow somewhere in the parent element.

Regards,
Vitalii



SR Sivakumar R Syncfusion Team April 28, 2016 11:30 AM UTC

Hi Vitali, 
 
Your requirement can be achieved by handling QueryRowHeight event as in the below code snippet, 
 
using Syncfusion.UI.Xaml.Grid; 
using Syncfusion.UI.Xaml.Grid.Helpers; 
 
this.datagrid.QueryRowHeight += datagrid_QueryRowHeight;    
 
void datagrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e) 
{ 
    if (this.AssociatedObject.IsFilterRowIndex(e.RowIndex)) 
    { 
        e.Height = 60; 
        e.Handled = true; 
    } 
} 
 
Thanks, 
Sivakumar 



VI vitalii April 28, 2016 11:44 AM UTC

Hi Sivakumar,

AssociatedObject is not available.
May be your answer about the GridDataControl?

My question is about SfDataGrid (not GridDataControl)

Regards,
Vitalii


SR Sivakumar R Syncfusion Team April 28, 2016 12:19 PM UTC

Hi Vitalii, 
 
Sorry for the inconvenience. Find the modified code snippet below, 
 
using Syncfusion.UI.Xaml.Grid;  
using Syncfusion.UI.Xaml.Grid.Helpers;  
  
this.datagrid.QueryRowHeight += datagrid_QueryRowHeight;     
  
void datagrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e)  
{  
    if (this.datagrid.IsFilterRowIndex(e.RowIndex))  
    {  
        e.Height = 60;  
        e.Handled = true;  
    }  
}  
 
Thanks, 
Sivakumar 



VI vitalii April 28, 2016 12:48 PM UTC

Hi, Sevakumar

Your last example does not work for me ((.
datagrid is not avaliable.

My code:

using Syncfusion.UI.Xaml.Grid;
using Syncfusion.UI.Xaml.Grid.Helpers;
public class MyDataGridSfDataGrid
{
public MyDataGrid()
{
     QueryRowHeight += PfDataGrid_QueryRowHeight;
}
void PfDataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e)    {     if (this.datagrid.IsFilterRowIndex(e.RowIndex))        //cannot resolve datagrid 
      {
     }

      if (datagrid.IsFilterRowIndex(e.RowIndex))             //cannot resolve datagrid 
      {
     }

if (this.GetDataGrid().IsFilterRowIndex(e.RowIndex))   //GetDataGrid() always null
      {
     }
}
}


Regards,
Vitalii



SR Sivakumar R Syncfusion Team April 28, 2016 03:35 PM UTC

Hi Vitalii, 

We have prepared sample based on your requirement. Please find the sample from the below location. 

Thanks, 
Sivakumar 



VI vitalii May 4, 2016 06:17 PM UTC

Hi, Sivakumar,
Your last example helped me.  )))
Thank you.

Regargs,
Vitalii



JG Jai Ganesh S Syncfusion Team May 5, 2016 08:19 AM UTC

Hi Vitalii, 
 
Thank you for the update. 
 
Please let us know if you need further assistance on this. 
 
Regards, 
Jai Ganesh S 


Loader.
Live Chat Icon For mobile
Up arrow icon