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

RadGrid Filter with AutoPostBackOnFilter

2 Answers 373 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eric Klein
Top achievements
Rank 1
Eric Klein asked on 03 Dec 2009, 07:02 PM

Ok I have some very odd behavior with a radgrid.  I am trying to set it up so that it will filter the columns when the enter key is hit.  I have set up the gid and it never seems to acknowledge the enter key being pressed, but it will work when I hit the tab key.  I can live with this if necessary, but the odd thing is this.

When the page loads I can filter the column, case sensitive, on whatever column I have set up with AutoPostBackOnFilter = true.  The issue is when I go to another column and try to filter it.  If it is not set to AutoPostBackOnFilter and use the GUI drop down it works.  But if I try and filter on another column with AutoPostBackOnFilter set to true the grid does not filter and blanks out the filter box when I tab off it.

 More odd behavior I can keep filter on whatever column I first filtered on with no issue, except when I do certain things, like try to filter on another column with the Autopost back set and then remove filter on a column without autopostback and then try to filter with my original column.  Then it does the same thing blanks the filter box and does not filter.

 It always filters if I do not use autopostback.  Here is some of the code.

 

 <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True"   
                    GridLines="None" 
                    Skin="WebBlue" AllowFilteringByColumn="True" 
                    AutoGenerateColumns="False" 
                    EnableTheming="False" onneeddatasource="RadGrid1_NeedDataSource"   
                    ShowGroupPanel="True">     
               <HeaderContextMenu EnableTheming="True">                  
               <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
               </HeaderContextMenu> 
               <MasterTableView  DataKeyNames="ClientID">  
               <RowIndicatorColumn> 
                  <HeaderStyle Width="20px"></HeaderStyle> 
               </RowIndicatorColumn> 
               <ExpandCollapseColumn> 
               <HeaderStyle Width="20px"></HeaderStyle> 
               </ExpandCollapseColumn> 
               <Columns> 
                   <telerik:GridBoundColumn DataField="ClientID" DataType="System.Int32"   
                       HeaderText="ClientID" ReadOnly="True" SortExpression="ClientID"   
                       UniqueName="ClientID" Visible="false">  
                   </telerik:GridBoundColumn> 
                   <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name"   
                       SortExpression="LastName" UniqueName="LastName" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" > 
                   </telerik:GridBoundColumn> 
                   <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" 
                       SortExpression="FirstName" UniqueName="FirstName">  
                   </telerik:GridBoundColumn>                     
                   <telerik:GridBoundColumn DataField="RecordAccountName" HeaderText="Account Name"   
                       SortExpression="RecordAccountName" UniqueName="RecordAccountName">  
                   </telerik:GridBoundColumn>                     
                   <telerik:GridBoundColumn DataField="StrategyTypeDescription"   
                       HeaderText="Strategy" SortExpression="StrategyTypeDescription"   
                       UniqueName="StrategyTypeDescription" Groupable="true" GroupByExpression="StrategyTypeDescription, Sum(InitialInvestmentAmount) GroupTotal [Group Total]  Group By StrategyTypeDescription">  
                   </telerik:GridBoundColumn> 
                   <telerik:GridBoundColumn DataField="IntermediaryDescription"   
                       HeaderText="Intermediary" SortExpression="IntermediaryDescription"   
                       UniqueName="IntermediaryDescription">  
                   </telerik:GridBoundColumn> 
That is some of the grid code

protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
        {  
 
            RadGrid1.DataSource = ClientBLL.GetClientsNotInvested();  
                    } 
        public static List<APAPortal.vw_clients_pending> GetClientsNotInvested()  
        {  
            APADataContext db = new APADataContext();  
            var query = from c in db.vw_clients_pendings  
                        select c;  
              
            return query.ToList();  
 
        } 
Any ideas?  I have tried to set the grid with RadAjaxControl, and numerous other ways.

Sorry just discoverd that it is using controls version 2008.3.1314.  This might be the issue

2 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 09 Dec 2009, 08:23 AM
Hello Eric,

Can you please see whether you are still experience same behavior with latest version RadControls for ASP.NET AJAX? There are few improvements with RadGrid filtering with latest official release.

Kind regards,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Eric Klein
Top achievements
Rank 1
answered on 09 Dec 2009, 01:57 PM
Sorry I ment to repost.  When I used the new version it worked as expexted.  Looks like it was an issue with the old version of the controls.
Tags
Grid
Asked by
Eric Klein
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Eric Klein
Top achievements
Rank 1
Share this question
or