Filter not Filtering

6 posts, 0 answers
  1. Jon-Jon Kershaw
    Jon-Jon Kershaw avatar
    49 posts
    Member since:
    Dec 2008

    Posted 14 Jan 2009 Link to this post

    Filtering not working on simple databind. Even when the filter tries to display it doesn't even show the no records template.  Code below.

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucReportList.ascx.cs" 
        Inherits="uc_reporting_ucReportList" %> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <br /> 
    <div id="ReportLIstDiv"
        <asp:UpdatePanel ID="UpdatePanel3" runat="server"
            <ContentTemplate> 
                <table id="ContentTable"
                <tr> 
                <td colspan="3"
                    <telerik:RadGrid ID="RadGridReportInbox" runat="server" Skin="Vista" OnSelectedIndexChanged="RadGridReportInbox_SelectedIndexChanged" 
                        GridLines="None" AllowFilteringByColumn="True" AllowPaging="True" PageSize="5"  
                        AutoGenerateColumns="False" OnPageIndexChanged="RadGridReportInbox_PageIndexChanged" EnableLinqExpressions="False" GroupingSettings-CaseSensitive="false"
                        <HeaderContextMenu EnableTheming="True"
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </HeaderContextMenu> 
                        <MasterTableView> 
                         <Columns> 
                                        <telerik:GridButtonColumn CommandName="Select" Text="Select" UniqueName="Select"
                                        </telerik:GridButtonColumn> 
                                        <telerik:GridBoundColumn DataField="Name" FilterControlWidth="150px" HeaderText="Name" 
                                            UniqueName="Name"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="Extension" FilterControlWidth="150px" HeaderText="Extension" 
                                            UniqueName="Extension"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="CreationTime" FilterControlWidth="150px" HeaderText="Creation Time" 
                                            UniqueName="Creation Time"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="Delete"
                                        </telerik:GridButtonColumn> 
                        </Columns> 
                            <NoRecordsTemplate> 
                                No Records Found. 
                            </NoRecordsTemplate> 
                            <RowIndicatorColumn> 
                                <HeaderStyle Width="20px" /> 
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn> 
                                <HeaderStyle Width="20px" /> 
                            </ExpandCollapseColumn> 
                        </MasterTableView> 
                        <ClientSettings AllowColumnsReorder="True"
                            <Selecting AllowRowSelect="True" /> 
                        </ClientSettings> 
                        <FilterMenu EnableTheming="True"
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </FilterMenu> 
                    </telerik:RadGrid> 
                </td> 
                </tr> 
                    <tr> 
                        <td> 
                            <asp:UpdatePanel ID="UpdatePanel4" runat="server"
                                <ContentTemplate> 
                                    <telerik:RadTreeView ID="RadTreeView1" runat="server" Skin="Vista" EnableDragAndDrop="True" 
                                        OnNodeDrop="RadTreeView1_NodeDrop"
                                    </telerik:RadTreeView> 
                                </ContentTemplate> 
                            </asp:UpdatePanel> 
                        </td> 
                        <td> 
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                        </td> 
                        <td> 
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server"
                                <ContentTemplate> 
                                    <asp:Panel ID="PanelRealTime" runat="server" BorderColor="#0000CC"  
                                        BorderStyle="Dotted" ToolTip="Drag and Drop Desired Report" Width="250px"
                                                                    Execute Real-Time Report 
                                    <br /> 
                                    <asp:Label ID="LabelSelectedReport" runat="server" Text=""></asp:Label> 
                                    </asp:Panel>                              
                                </ContentTemplate> 
                            </asp:UpdatePanel> 
                        </td> 
                        <td> 
     
                        </td> 
                    </tr> 
                </table> 
            </ContentTemplate> 
    </asp:UpdatePanel> </div>  



  2. Serrin
    Serrin avatar
    286 posts
    Member since:
    Sep 2008

    Posted 14 Jan 2009 Link to this post

    Hey Jon-Jon,

    Well, I tested your grid code outside of there and had no problems with it, worked like a charm when I attached a simple SQL data source.  Where are you using this control at, perhaps there is some global css that is giving it trouble?  Could you post the code for the page containing this control and for where the databind is coming from?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jon-Jon Kershaw
    Jon-Jon Kershaw avatar
    49 posts
    Member since:
    Dec 2008

    Posted 14 Jan 2009 Link to this post

    Well we have this content page nested within a default page that is nested with in a master.content page.  A global css could very well be the cause because we haven't even started on dealing with the levels of where the css is applied to what page.

    The code I used to bind is a basic bind and is as follows:
     
    public void BuildInboxPresentation() 
        { 
            this.RadGridReportInbox.DataSource = null
            this.RadGridReportInbox.DataSourceID = null
     
            List<System.IO.FileInfo> FileList = new List<System.IO.FileInfo>(); 
            foreach (System.IO.FileInfo fi in this.FileInfo) 
            { 
                FileList.Add(fi); 
            } 
            this.RadGridReportInbox.DataSource = this.FileInfo; 
            this.RadGridReportInbox.DataBind(); 
     
        } 

    Hope this helps...if you need anything else let me know.

  5. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 15 Jan 2009 Link to this post

    Hello Jon-Jon Kershaw,

    The filtering feature of RadGrid is not supported with simple binding and DataBind() calls. This is outlined in the Description section of the following online demo of the product:

    http://demos.telerik.com/aspnet-ajax/Grid/Examples/GeneralFeatures/Filtering/DefaultCS.aspx

    If you would like to take advantage of this grid feature, you will need to switch to advanced binding using NeedDataSource event handling or a data source control (as shown in the example linked above).

    Best regards,
    Sebastian
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Jon-Jon Kershaw
    Jon-Jon Kershaw avatar
    49 posts
    Member since:
    Dec 2008

    Posted 15 Jan 2009 Link to this post

    We do not want to use the SQL in the our code or XML is there any other way?

    We are using a MVC for the project and accessing the data in a datalayer so what do you suggest?
  7. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 16 Jan 2009 Link to this post

    Hi Jon-Jon Kershaw,

    RadGrid does not support grouping when used inside ASP.NET MVC and this detail is depicted in the following topic from the documentation:

    http://www.telerik.com/help/aspnet-ajax/mvc-limitations.html

    If the grouping feature of the grid is essential part of your implementation, you may consider using a hybrid application and nest the control in a regular ASP.NET page as discussed in this blog post.

    Kind regards,
    Sebastian
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017