This is a migrated thread and some comments may be shown as answers.

Customize filtering row

3 Answers 81 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Skurken
Top achievements
Rank 1
Skurken asked on 28 Jan 2011, 10:20 AM
Hi there guys

I'm trying to customize the filtering row in a Winform Telerik Grid. What I want is to hide the Filter Icon and only show the text boxes. When a user enteres text in the text box it should apply the "Contains" filter on the column.

I have been using Telerik ASP Net. Radgrid quite a lot and could set the "ShowFilterIcon=false" and on the gridboundcolumn and "AutoPostBackOnFilter=true" to get the desired functionality.

Any hints?

3 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 28 Jan 2011, 11:33 AM
Hello,

In order to hide the filter icon in the grid, you'll need to subscribe to the ViewCellFormatting event. This can be done in the following way:

this.radGridView1.ViewCellFormatting += new CellFormattingEventHandler(radGridView1_ViewCellFormatting);

void radGridView1_ViewCellFormatting(Object sender, CellFormattingEventArgs e)
{
    if (e.CellElement is GridFilterCellElement)
    {
        GridFilterCellElement cell = (GridFilterCellElement)e.CellElement;
        cell.FilterButton.Image = null;
    }
      
}

You can learn about setting filters programatically at this documentation link
Hope that helps
Richard
0
Skurken
Top achievements
Rank 1
answered on 03 Feb 2011, 09:49 AM
Thanks for the reply Richard!
0
Richard Slade
Top achievements
Rank 2
answered on 03 Feb 2011, 09:56 AM
You're welcome. Glad I could help
Richard
Tags
GridView
Asked by
Skurken
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Skurken
Top achievements
Rank 1
Share this question
or