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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

style FilterRow in SfDataGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

123860 Apr 27,2016 02:52 PM UTC May 5,2016 08:19 AM UTC WPF 9
loading
Tags: SfDataGrid
vitalii
Asked On April 27, 2016 02:52 PM UTC

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

Regards,
Vitalii

Jai Ganesh S [Syncfusion]
Replied On 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 


vitalii
Replied On 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


Sivakumar R [Syncfusion]
Replied On 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 


vitalii
Replied On 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

Sivakumar R [Syncfusion]
Replied On 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 


vitalii
Replied On 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


Sivakumar R [Syncfusion]
Replied On 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 


vitalii
Replied On May 4, 2016 06:17 PM UTC

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

Regargs,
Vitalii


Jai Ganesh S [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;