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
0
Hi Aswin Suriya,
Julian Benkov
the Telerik team
Please take a look at this article for RowFilter syntax of DataView. RadGridView uses the same escape syntax and functionality.
I hope this helps.
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.
Any solution specific to my issue will be more helpful.
0
Accepted
Hello Aswin Suriya,
The new Q2 2010 release will be available very soon this month. Greetings,
Julian Benkov
the Telerik team
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 ?
Thank you for the update.
Do i get any telerik points for pointing this new issue ?
0
Yes Aswin Suriya, your Telerik points have been updated.
All the best,
Julian Benkov
the Telerik team
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.
Thank you very much.