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

[Solved] Entity Framework Linq FilterExpression

1 Answer 200 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 08 Jul 2009, 02:26 PM
I am trying to avoid retrieving all rows by setting an initial filter, but it is not working. The full list is returned. What is the correct FilterExpression syntax? Thank you for any help.

 

<telerik:RadGrid ID="RadGridCompany" runat="server" 
AllowFilteringByColumn="True" AutoGenerateColumns="False"
DataSourceID="EntityDataSourceCompany" GridLines="None" AllowPaging="true"
PageSize="100" onselectedindexchanged="RadGridCompany_SelectedIndexChanged"
onitemcommand="RadGridCompany_ItemCommand">
.
.  
            <MasterTableView DataSourceID="EntityDataSourceCompany" 
            FilterExpression = "(it.[OrganizationName] == 'Non Existent')">
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>

                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridButtonColumn
                        CommandName="Select"
                        Text="Select"
                        UniqueName="Select">
                        <HeaderStyle Width="10%" />
                    </telerik:GridButtonColumn>
                    <telerik:GridBoundColumn DataField="OrganizationName" HeaderText="Company Name" 
                        ReadOnly="True" SortExpression="OrganizationName" UniqueName="OrganizationName"
                        AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith"  FilterControlWidth="250px" >
                        <HeaderStyle Width="90%" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="OrganizationID" Display="False"
                        HeaderText="Organization ID" ReadOnly="True" SortExpression="OrganizationID"
                        UniqueName="OrganizationID">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>

.
.
<asp:EntityDataSource ID="EntityDataSourceCompany" runat="server"
ConnectionString="name=LQDModel" DefaultContainerName="LQDModel"
EntitySetName="Organization"  OrderBy="it.OrganizationName"
Select="it.[OrganizationName], it.[OrganizationID]">
</asp:EntityDataSource>

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 10 Jul 2009, 01:20 PM
Hello Macrel,

Your filtering expression should be working as expected as evidenced by the attached sample.

Could  you provide more information.

Thanks.

Greetings,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Marcel
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or