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

2011.Q1 quotes and filters

2 Answers 34 Views
GridView
This is a migrated thread and some comments may be shown as answers.
simone bartoccioni
Top achievements
Rank 1
simone bartoccioni asked on 24 Mar 2011, 08:19 PM
Hello

After upgrading to the last release I have a problem with quotes (') and filters.

Example:
I Click on a filter button of a column, and I choose the item :  L'Abbondanza
Then I apply the filter, but the result row is not shown

The grid applyes this wrong filter clause :   RAGSOC = 'L''''Abbondanza' and not  RAGSOC = 'L''Abbondanza'

No problem with previous version....

Thanks in advance
Simone

2 Answers, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 25 Mar 2011, 10:05 AM
Hello Simone,

I can confirm this issue and i would suggest you open a support ticket on this problem.

Until then i can provide a workaround for this issue:
void radGridView1_FilterChanging(object sender, GridViewCollectionChangingEventArgs e)
{
    if (e.NewItems.Count > 0)
    {
        var compositeFilterDescriptor = e.NewItems[0] as CompositeFilterDescriptor;
        if (compositeFilterDescriptor != null && compositeFilterDescriptor.FilterDescriptors.Count > 0)
        {
            foreach (var filterDescriptor in compositeFilterDescriptor.FilterDescriptors)
            {
                if (filterDescriptor.Value != null)
                {
                    filterDescriptor.Value = filterDescriptor.Value.ToString().Replace("''", "'");
                }
                 
            }
        }
    }
}

This should fix your problem for now.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
simone bartoccioni
Top achievements
Rank 1
answered on 25 Mar 2011, 07:51 PM
Thanks Emanuel 

Simone
Tags
GridView
Asked by
simone bartoccioni
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
simone bartoccioni
Top achievements
Rank 1
Share this question
or