X - How to change Filter control size?

Hi,I want to further shrink these dimensions, please show me how to achieve this!

also, I do not see filtertype.notcontains, does this function exist?  Do I need to perform the override search function as you shown?
Many thanks!

13 Replies

FP Farjana Parveen Ayubb Syncfusion Team June 22, 2020 11:52 AM UTC

Hi Khanh, 
 
Thank you for using Syncfusion controls. 
 
I want to further shrink these dimensions, please show me how to achieve this! 
We have internally set the Minimum width and height for GridFilterControl, if you shrink means the look and feel of GridFilterControl is not good, Did you need that? 
I do not see filtertype.notcontains, does this function exist?  Do I need to perform the override search function as you shown? 
Already we have a DoesNotContains filter type in TextFilter, please find the below UG link, 
 
 
 
Regards, 
Farjana Parveen A 



TG The GridLock June 23, 2020 06:55 PM UTC

 Hi Farjana,
question1: Yes I have seen that, however I would like to be smaller to balance my form.(i need only textbox - checkbox filter and ok-cancel button)
question2: I want to use filter.notcontain but run by code. I need filtertype: = filtertype.notcontains. (I have solved this problem for now, but let me know if you have that enum available).
More question: 
I need to add a cell border option (drawing for some cells but not an entire grid or column), 

can you provide possible border types as this!

private Sub SfDataGrid1_QueryCellStyle
e.Style.Borders(0).linestyle=...//enum for borderline-top
e.Style.Borders(1).color=...     //enum for borderline-left
e.Style.Borders.color=...         //for all borders
end sub
Notes: I want can draw at least one edge
Thanks you.


SS Susmitha Sundar Syncfusion Team June 24, 2020 02:52 AM UTC

Hi Khanh, 
 
Thank you for the update. 
 
Query 1: Yes I have seen that, however I would like to be smaller to balance my form. 
 
Currently, we are checking feasibility to achieve your requested behavior “Need to shrink the FilterPopUp size”. We will update you with details on or before 25, 2020. 
 
We appreciate your patience until then. 
 
Query 2: I want to use filter.notcontain but run by code. I need filtertype: = filtertype.notcontains. (I have solved this problem for now, but let me know if you have that enum available). 
 
Yes, we have provided the support for FilterType.NotContains enum. 
 
  
 sfDataGrid1.Columns["CustomerID"].FilterPredicates.Add(new FilterPredicate() { FilterType = FilterType.NotContains, FilterValue = "ANATR",FilterBehavior=FilterBehavior.StringTyped }); 
 
 
Query 3: I need to add a cell border option (drawing for some cells but not an entire grid or column),  
 
You can set the Cell borders for specific cell only by using SfDataGrid.QueryCellStyle event. 
 
 
private void SfDataGrid1_QueryCellStyle(object sender, QueryCellStyleEventArgs e) 
{ 
    if(e.DisplayText =="Thomas Hardy") 
    { 
        e.Style.Borders.All = new GridBorder(GridBorderStyle.Dotted, Color.Blue, GridBorderWeight.Thin); 
        e.Style.Borders.All = new GridBorder(GridBorderStyle.Dotted, Color.Blue, GridBorderWeight.Thin); 
    } 
} 
 
 
 
 
 
Please check the sample and let us know if you need further assistance on this. 
 
Regards, 
Susmitha S 



TG The GridLock June 25, 2020 09:43 AM UTC

Hi susmitha,
 how to hide this column or icon as image? 


also, can i change these line scale? I want to stretch them further... because the borders shown are not very clear (myimage)


continue: can i add a button as a part of a cell as this?



SS Susmitha Sundar Syncfusion Team June 25, 2020 02:26 PM UTC

Hi khanh dang, 
 
Thank you for the update. 
 
Query 1: how to hide this column or icon as image?  
 
You can hide that column by using ExpanderColumnWidth as 0.  
 

Query 2: also, can i change these line scale? I want to stretch them further. 
 
We can’t achieve that munch of stretch in Winforms application. 
 
Query 3: can i add a button as a part of a cell as this? 
 
Yes, you can achieve this by create the custom column. 
 
 
//TextButtonColumn  
  
 this.sfDataGrid.Columns.Add(new GridTextButtonColumn() { MappingName = "CustomerID", Width = 140});  
  
 
  
 
 
 
Please check the sample and let us know if you need further assistance on this. 
 
Regards, 
Susmitha S 



TG The GridLock June 25, 2020 11:21 PM UTC

Hi Susmitha,
I have achieved these query. thanks!


MA Mohanram Anbukkarasu Syncfusion Team June 26, 2020 11:28 AM UTC

Hi khanh dang,  

Thanks for the update.  

We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you.  

Regards,  
Mohanram A. 



TG The GridLock June 28, 2020 06:23 PM UTC

Hi Mohanram , please check event_trigger with enter.




SS Susmitha Sundar Syncfusion Team June 29, 2020 12:50 PM UTC

Hi khanh dang, 
 
Sorry for the inconvenience caused.   
 
We have just override the KeyDown method for customize this. In this method we have used the custom selection controller. But we did not implement this. Now, we have removed this. Now KeyDown event works as default. 
 
 
Please check the sample and let us know if you need further assistance on this. 
 
Regards, 
Susmitha S 



TG The GridLock June 30, 2020 07:42 AM UTC

ok susmitha. i get it now.


SS Susmitha Sundar Syncfusion Team July 1, 2020 05:17 AM UTC

Hi khanh dang, 
 
Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Susmitha S 



PA Pat February 20, 2023 11:46 PM UTC

Hello,

I am also looking to shrink the width and height of the GridFilterControl to a smaller size. Currently it is larger than the theme of my application and does not look and feel congruent with the application.

Can you please let me know how to achieve this?

Thanks,

Pat



VS Vijayarasan Sivanandham Syncfusion Team February 21, 2023 05:45 PM UTC

Hi Pat,

To ensure that the filter control features are displayed correctly in the FilterPopup, we have set a minimum width of 298 and a minimum height of 448 for the GridFilterControl. We regret to inform you that it is not possible to reduce the size of the GridFilterControl below these minimum dimensions.

Regards,
Vijayarasan S


Loader.
Up arrow icon