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

Filter is not working for double quotes

6 Answers 159 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Aswin S
Top achievements
Rank 1
Aswin S asked on 21 Jun 2010, 06:48 AM

FilterExpression filter = 
new FilterExpression(); 
                    filter.Predicates.Add(FilterExpression.BinaryOperation.AND, 
                       GridKnownFunction.Contains, 
                       "@FilterEditor1"); 
                    filter.Parameters.Add("@FilterEditor1", "rgvKeyword.CurrentRow.Cells[0].Value"); 
                    rgvEmails.Columns["tk_name"].Filter = filter; 

Above is my code to apply filter to the grid column "tk_name" programatically.
Filtering works great for normal alphabetic string.
But, If the filtertext contains any double quote character("), the filtering functionality won't work. it just displays all the records.

Is this a bug or Is there any escape seq. for double quote character in filtertext?

Please help.

6 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 24 Jun 2010, 08:46 AM
Hi Aswin Suriya,

Please take a look at this article for RowFilter syntax of DataView. RadGridView uses the same escape syntax and functionality.

I hope this helps.

Best wishes,
Julian Benkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Aswin S
Top achievements
Rank 1
answered on 30 Jun 2010, 11:16 AM
I googled almost 2 hours. I still cannot able to find a solution for this Double Quote(") issue :(

Any solution specific to my issue will be more helpful.
0
Accepted
Julian Benkov
Telerik team
answered on 02 Jul 2010, 04:33 PM
Hello Aswin Suriya,

We did a test with the current version of RadGridView control and found the issue with escaping the double quotes in the filtering operation.

In the new version of the control the problem will not exist. Here is an example with the new filtering API:

[TestMethod]
public void DoubleQuotesFilteringTest()
{
    using (Form form = new Form())
    {
        form.Size = new System.Drawing.Size(640, 480);
        RadGridView grid = new RadGridView();
        grid.Dock = System.Windows.Forms.DockStyle.Fill;
        grid.EnableFiltering = true;
        form.Controls.Add(grid);
 
        DataTable table = new DataTable("table");
        table.Columns.Add("ID");
        table.Columns.Add("Name");
        table.Columns.Add("City");
        table.Columns.Add("Value", typeof(byte));
 
        table.Rows.Add("111", "Nancy Davolio", "Seattle", 12);
        table.Rows.Add("222", "Andrew Fuller", "Tacoma", 4);
        table.Rows.Add("333", "Janet Leverling", "Kirkland", 6);
        table.Rows.Add("444", "Margaret \"Peacock", "Redmond", 8);
        table.Rows.Add("555", "Steven Buchanan", "London", 2);
        table.Rows.Add("666", "Michael Suyama", "London", 1);
        table.Rows.Add("777", "Robert King", "London", 1);
        table.Rows.Add("888", "Laura Callahan", "Seattle", 5);
        table.Rows.Add("999", "Anne Dodsworth", "London", 2);
 
        grid.DataSource = table;
        form.Show();
 
        grid.FilterDescriptors.Add("Name", FilterOperator.Contains, "\"");
       
        Assert.AreEqual(1, grid.ChildRows.Count);
        Assert.AreEqual("444", grid.ChildRows[0].Cells[0].Value);
    }
}

          
The new Q2 2010 release will be available very soon this month.

Greetings,
Julian Benkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Aswin S
Top achievements
Rank 1
answered on 02 Jul 2010, 06:31 PM
Hi Julian Benkov,

Thank you for the update.

Do i get any telerik points for pointing this new issue ?
0
Julian Benkov
Telerik team
answered on 07 Jul 2010, 12:35 PM
Yes Aswin Suriya, your Telerik points have been updated.

 All the best,
Julian Benkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Aswin S
Top achievements
Rank 1
answered on 07 Jul 2010, 12:48 PM
Hi Julian Benkov,

Thank you very much.
Tags
GridView
Asked by
Aswin S
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Aswin S
Top achievements
Rank 1
Share this question
or