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

Custom radgrid filter with textbox and button

3 Answers 244 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Roland
Top achievements
Rank 1
Roland asked on 21 Jan 2009, 06:41 PM
Hello, I was wondering if I can get some help  implementing a fillter in a  radgrid inside a  web part.
Our clients do not like the built-in filter that is bundled with telerik Radgrid. Instead, I created a text box and a submit button for them to enter text and then push submit to filter the grid.

For the life of me, I can't get my  grid to filter in my webpart during the button click postback,

 Bellow is code that handles by button click to  filter

     void btnfilter_Click(object sender, EventArgs e)
        {

            lblSearch.Text = txtSearch.Text.ToString() ;

            oGrid.MasterTableView.FilterExpression = "([URLwMenu] LIKE \'%" + lblSearch.Text + "%\') ";
            GridColumn column = oGrid.MasterTableView.GetColumnSafe("Campaign");
            column.CurrentFilterFunction = GridKnownFunction.Contains;
            column.CurrentFilterValue = lblSearch.Text;
            oGrid.MasterTableView.Rebind();

        }

any assistance will be greatly appreciated.
-roland

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 21 Jan 2009, 06:56 PM
Hello Roland,

Please examine the following links which may give you some ideas to start with:
Search on key press/button click
Web Mail Grid demo

Let us know if you need more information.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Roland
Top achievements
Rank 1
answered on 23 Jan 2009, 06:35 PM
Thanks for the  Response Daniel,
The links were similar in concept but I just can't get the radgrid filter to work in a Web part  sitting in  sharepoint 2007 site.
 
 the Eventhandler that takes care of the button click and the filtering  is where I'm having problems.

void btnfilter_Click(object sender, EventArgs e)
        {

            oGrid.MasterTableView.FilterExpression = "(Campains LIKE \'%" + lblSearch.Text + "%\') ";
            oGrid.MasterTableView.Rebind();

        }



Any other suggestions?
0
Daniel
Telerik team
answered on 27 Jan 2009, 02:47 PM
Hello Roland,

I suppose that you may be using simple databinding in your web part. Would you share your code with us? In this way I will be able to assist you further.

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Roland
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Roland
Top achievements
Rank 1
Share this question
or