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

Error when trying to filter on a Dictonary<int, string>

2 Answers 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 08 Aug 2011, 04:59 PM
Hi there,

I'm using a custom GridTemplateColumn to do some filtering. The filter combo-box is bound to a Dictionary<int, string> and renders with no problems; it's bound with:

            rcBox.DataTextField = "value";
            rcBox.DataValueField = "key";

When I try to select an item from the list however, I get an error message "Expression expected" with the following code:

        private void rcBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair());
        }

The code was previously:

        private void rcBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair("EqualTo", this.UniqueName));
        }

but that also gives "Expression Expected" with a UniqueName value of "key".

Any thoughts?

Thank you,

Mike K.

2 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 11 Aug 2011, 02:01 PM
Hi Mike,

I advise you to try setting the EnableLinqExpressions property of the grid to false. Let us know if the issue persists afterwards.

Greetings,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Mike
Top achievements
Rank 1
answered on 06 Sep 2011, 03:53 PM
I'm no longer using the GridTemplateColumn, so it's a moot point now, but thank you for your help.

Mike Kingscott
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Mike
Top achievements
Rank 1
Share this question
or