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

How do I remove the filter three fields

Good afternoon,
I own a gridGroupingControl, with two columns.
I also put the filter that comes in gridGroupingControl.
But in the filter appears by default: All, Custom ... Empty.
And then the list of column options.
Example filter column User:
(All)
(Custom. ..)
(Empty)
Alan
Roberth
Cleber
Eduardo
Diego

But I do not want these options appear in the filter:
(All)
(Custom. ..)
(Empty)

As I do I get those three filter options gridGroupingControl's column?

thank


9 Replies

JJ Jisha Joy Syncfusion Team May 3, 2011 09:49 AM UTC

Hi Tomio,

To achieve this, you need to implement a custom filterbar cell deriving the cellmodel / cellrenderer from GridTableFilterBarCellModel / GridTableFilterBarCellRenderer. Please refer to the following Kb for more details,

http://www.syncfusion.com/support/kb/666/How%20do%20I%20hide%20the


Sample can be obtained form the following link,

http://help.syncfusion.com/samples/kb/grid.windows/GGCRemoveCustom/Custom.zip

Please let me know if this helps.

Regards,
Jisha





TO Tomio May 5, 2011 02:53 PM UTC

Thank you, It worked.

Only now am having another problem:

In the same gridGroupingControl is also possible to make grouping and filtering.

When not collated the width of the items are the Filter column width.

Only when it is grouped, the filter of the first column the width of the list items are smaller than the width of the column.

What do I do to keep the size of the column width?

segue um imagem do problema:

Tank



filter_cfac6eab.zip


RC Rajadurai C Syncfusion Team May 9, 2011 09:15 AM UTC

Hi Tomio,

Thanks for your update.

To set the width of the filter dropdown equal to that of respective column width, you can handle the TableControlCurrentCellShowingDropDown with the following code handled in it.

GridCurrentCell cc = e.TableControl.CurrentCell;
if (cc.Renderer is GridComboBoxCellRenderer)
{
GridComboBoxCellRenderer rend = cc.Renderer as GridComboBoxCellRenderer;
GridComboBoxListBoxPart lb = rend.ListBoxPart as GridComboBoxListBoxPart;

lb.Size = new Size(c, 100); //c is width of the column
}


Regards,
Rajadurai



TO Tomio May 9, 2011 08:09 PM UTC

Good afternoon.

Thanks for the help but did not work.

Remains the way it was

Follows a model of the problem in VB. And two pictures also show the problem.

I would resaltar that the problem only happens with the filter of the first column when the column is grouped.

Problem: the width of the filter list is smaller than the width of the column.

Tank



TO Tomio May 10, 2011 01:46 PM UTC

Good afternoon.

Thanks for the help but did not work.

Remains the way it was

Follows a model of the problem in VB. And two pictures also show the problem.

I would resaltar that the problem only happens with the filter of the first column when the column is grouped.

Problem: the width of the filter list is smaller than the width of the column.

Tank



Custom_5c36e863.rar


TO Tomio May 10, 2011 01:59 PM UTC

Good afternoon.

Thanks for the help but did not work.

Remains the way it was

Follows a model of the problem in VB. And two pictures also show the problem.

I would resaltar that the problem only happens with the filter of the first column when the column is grouped.

Problem: the width of the filter list is smaller than the width of the column.

Tank



Form1_28c2c611.rar


TO Tomio May 10, 2011 02:03 PM UTC

Good afternoon.

Thanks for the help but did not work.

Remains the way it was

Follows a model of the problem in VB. And two pictures also show the problem.

I would resaltar that the problem only happens with the filter of the first column when the column is grouped.

Problem: the width of the filter list is smaller than the width of the column.

Tank



Form1_9d640379.rar


TO Tomio May 11, 2011 03:08 PM UTC

Good morning.

I managed to solve the problem.
I got the code:

Private Sub gridgrouping_tablecontrolcurrentcellshowingdropdown(ByVal sender As System.Object, ByVal e As Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellShowingDropDownEventArgs) Handles gridGrouping.TableControlCurrentCellShowingDropDown
Dim widthcollumn As Integer = gridGrouping.TableDescriptor.Columns(0).Width
If (e.Inner.Size.Width < widthcollumn) Then
widthcollumn += 17
e.Inner.Size = New Size(widthcollumn, e.Inner.Size.Height)
End If
End Sub

thank





RC Rajadurai C Syncfusion Team May 16, 2011 07:08 PM UTC

Hi Tomio,

We are glad to hear that your requirement had been achieved.

Thank you for using Syncfusion Products.

Regards,
Rajadurai


Loader.
Live Chat Icon For mobile
Up arrow icon