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

FilterBar in GridGroupingControl - Specific Columns?

I've had a brief look through the forums and couldn't find any information pertaining to this specific request... so here it is:

Is there any way to control explicitally, either at design-time or run-time which columns will contain a DropDownList for the filtering? I imagine one way would be to use custom filtering, but I'm just wondering if there's a way to do it with the built-in filter controls.

Additionally is there a way to disable the "custom (...)" button next to the DropDownList?

Many thanks :)


10 Replies

MD Matthew Dudley January 15, 2009 12:13 PM UTC

Update:

I had thought that if I disable the AllowFilter property of the column that this would remove the filter dropdown, however this wasn't the case:



Instead I've used the following in the DataBound event of the grid, however I want to know if there's a slicker way of achieving this?

[code]
protected void GridGroupingControl1_DataBound(object sender, EventArgs e)
{
for (Int16 i = 0; i < ((GridGroupingControl)sender).TableDescriptor.Columns.Count; i++)
{
if (i == 0 | i == 1 | i == 7 | i == 8)
((GridGroupingControl)sender).TableDescriptor.Columns[i].AllowFilter = true;
else
((GridGroupingControl)sender).TableDescriptor.Columns[i].AllowFilter = false;
}
}
[/code]

As you can see, I've checked specific column indexes in order to decide whether or not to show or hide the filter bar element.

Thanks,

Matt




BK Balaji K Syncfusion Team January 16, 2009 02:21 PM UTC

Hi Matt,

Thank you for your Interest in Syncfusion Products.

The above mentioned ways are the Best way to set the AllowFilter property.I would suggest you to iterate if you have many columns or you can directly specify in the page.

Please let us know if you have any queries.

Regards,
Balaji




MD Matthew Dudley January 19, 2009 08:57 AM UTC

Thanks for your response.

Unfortunately specifying directly in the page did not work for me so I had to use the iterative approach in code.

Could you check for me to see whether you are able to set specific columns for filter just using the page attributes?

Thanks,

Matt



BK Balaji K Syncfusion Team January 20, 2009 09:26 AM UTC

Hi Matt,

The Combo Filter has been depreciated so you will not be able to set for particular column in the page and we have come up with new FilterBarTextCell and ShowFilterBar.

Refer the below link to know more..

http://www2.syncfusion.com/ug_63/gridweb/FilterTextCell.html

Regards,
Balaji



SS Sherri Sanderson May 29, 2010 02:52 AM UTC

I just tried the link, but it gave me a 'page not displayed'. I'm also interested in only allowing filtering of certain columns. Thank you.


BM Bharath M Syncfusion Team June 1, 2010 08:53 AM UTC

Hi Sherri,

We regret for the inconvenience caused.

Could you please follow up with your query in the incident 68539, which you have created in DirectTrac?

Regards,
Bharath


JO Jeff O''Connell October 27, 2010 07:18 PM UTC

I'm having a real hard time finding out how to disable a filter combo for a particular column.

All searches on your site don't produce any solutions.

What's up with this feature. Is it available or not!

Jeff O'Connell



BM Bharath M Syncfusion Team October 28, 2010 03:51 AM UTC

Hi Jeff,

We regret for the inconvenience caused.

We can prevent displaying filter ComboBox in columns by using “QueryCellStyleInfo” event. Please refer the below code snippet to achieve this

[VB]
Private Sub GridGroupingControl1_QueryCellStyleInfo(ByVal sender As Object, ByVal e As GridTableCellStyleInfoEventArgs) Handles GridGroupingControl1.QueryCellStyleInfo

If e.TableCellIdentity.TableCellType = GridTableCellType.FilterBarCell Then

' Here we are removing filter for OrderID column
If e.TableCellIdentity.Column.Name = "OrderID" Then

' Setting None will remove the FilterControl from the filter bar
e.TableCellIdentity.TableCellType = GridTableCellType.None
End If

End If

End Sub


Let me know if you have any concerns.

Regards,
Bharath M



JO Jeff O''Connell June 12, 2014 08:18 PM UTC

Matthew,
 
did you ever get an answer to this aprt of your support question: 'Additionally is there a way to disable the "custom (...)" button next to the DropDownList?'
Thanks
Jeff


SS Satheeskumar S Syncfusion Team June 13, 2014 10:16 AM UTC

Hi Jeff,

We regret about the inconvenience caused,

Could you please follow up the incident 126170, which you have created in DirectTrac?. We have updated regarding this requirement in that incident.

Please let us know if you need any further assistance.

Regards,

Satheeskumar S


Loader.
Live Chat Icon For mobile
Up arrow icon