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

Standard filter problem

1 Answer 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hessner
Top achievements
Rank 2
Hessner asked on 04 Feb 2009, 04:58 PM
No matter what my input are, the result/sort order are the same.

It seems that the filter dosent "kick in".

Here are my code:

aspx:  
 
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" 
 AllowSorting="True" PageSize="3" AllowPaging="True" AutoGenerateColumns="False" AllowFilteringByColumn="True" EnableViewState="True" GridLines="None" ShowGroupPanel="True">  
 <PagerStyle Mode="NextPrevAndNumeric" /> 
   <MasterTableView ShowFooter="True">  
     <Columns> 
        <telerik:GridHyperLinkColumn DataTextFormatString="Ret" DataNavigateUrlFields="UserID" 
                                DataNavigateUrlFormatString="http://www.google.com/search?hl=en&amp;q={0}&amp;btnG=Google+Search" 
                                UniqueName="Ret" DataTextField="UserID" HeaderText="Ret" AllowFiltering="false" > 
       </telerik:GridHyperLinkColumn> 
       <telerik:GridHyperLinkColumn DataTextFormatString="Slet" DataNavigateUrlFields="UserID" DataNavigateUrlFormatString="javascript: void(alert('UserId={0}'));" 
       UniqueName="Slet" DataTextField="UserID" HeaderText="Slet"  AllowFiltering="false">  
       </telerik:GridHyperLinkColumn> 
       <telerik:GridBoundColumn UniqueName="Email" SortExpression="Email" HeaderText="E-mail" 
       DataField="Email" CurrentFilterFunction="StartsWith" AutoPostBackOnFilter="true">  
       </telerik:GridBoundColumn> 
       <telerik:GridBoundColumn UniqueName="FuldeNavn" SortExpression="FuldeNavn" HeaderText="Navn" 
       DataField="FuldeNavn">  
       </telerik:GridBoundColumn> 
       <telerik:GridBoundColumn UniqueName="Medlemsnummer" SortExpression="Medlemsnummer" 
       HeaderText="Medlemsnummer" DataField="Medlemsnummer">  
       </telerik:GridBoundColumn> 
       <telerik:GridBoundColumn UniqueName="RoleName" SortExpression="RoleName" HeaderText="Rolle" 
       DataField="RoleName">  
       </telerik:GridBoundColumn> 
       </Columns> 
     </MasterTableView> 
</telerik:RadGrid> 

 protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
        {  
            IObjectScope os = (IObjectScope)Context.Items["ObjectScopeProvider"];  
            IQueryable result = from x in os.Extent<UserRole>()  
                                where x.PortalID == 1  
                                select new { x.User.UserID, x.User.Email, x.User.FuldeNavn, x.Medlemsnummer, x.Role.RoleName };  
 
            RadGrid1.DataSource = result;   
         } 

The grid are filled every time I enter data to filter from (number of rows/sort order are the same).

1 Answer, 1 is accepted

Sort by
0
Hessner
Top achievements
Rank 2
answered on 04 Feb 2009, 09:54 PM
Ok, I found the solution:

 EnableLinqExpressions ="false"

solved it.

 

 

 

 

Tags
Grid
Asked by
Hessner
Top achievements
Rank 2
Answers by
Hessner
Top achievements
Rank 2
Share this question
or