开发者

FilterDescriptor in domain data source problem

I have below code in xaml.

    <dds:DomainDataSource x:Name="hastaDataSource" PageSize="10" LoadSize="40" QueryName="GetDzHST_HastaQuery" AutoLoad="True">
        <dds:DomainDataSource.DomainContext>
            <src:dysDomainContext/>
        </dds:DomainDataSource.DomainContext>
        <dds:DomainDataSource.FilterDescriptors>
            <dds:FilterDescriptor
                PropertyPath="HST_SoyAd"
                Operator="Contains"
                IgnoredValue=""
                Value="{Binding ElementName=txtHastaSoyad, Path=Text}" >
            </dds:FilterDescriptor>
            <dds:FilterDescriptor  
                PropertyPath="HST_Ad"
                Operator="Contains"
                IgnoredValue=""
                Value="{Binding ElementName=txtHST, Path=Text}" >
            </dds:FilterDescriptor>

        </dds:DomainDataSource.FilterDescriptors>

it gives error : Message: Unhandled Error in Silverlight Application Code: 4004

---> System.InvalidOperationException: The FilterDescriptor with its PropertyPath equal to 'HST_Ad' cannot be evaluated. ---> System.ArgumentException: Operator 'Contains' incompatible with operand typ开发者_Python百科es 'String' and 'Object' ---> System.InvalidOperationException: The type String does not expose a method called 'Contains'.

If I write one Filterdescriptor in FilterDescriptors node, I works fine but using multiple filter, it gives an error as above.

Please help. thanks..


I believe you need to add a FilterOperator to your DomainDataSource when you have multiple filters. The FilterOperator value should be either "And" or "Or".

So it should be either FilterOperator="And" or FilterOperator="Or".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜