RadGrid: some buttons and filters not working

3 posts, 0 answers
  1. Marco
    Marco avatar
    5 posts
    Member since:
    Apr 2015

    Posted 16 Apr 2015 Link to this post

    I am trying to recreate the example in the following demo:

    http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/exporting/export-word-csv/defaultcs.aspx

    In my case filtering by column is allowed and the data source is set in the code behind through the RadGrid1NeedDataSource method.

    The data is loaded correctly and shown in the table, sorting by clicking on the column names work, the page navigation at the bottom-left corner works fine.

    I am facing two problems:

    1) The buttons located at the bottom-center for going to a specific page and changing the page size don't work.

    2) None of the filters work, entering any text doesn't have any effect and pressing any filter icon, while using the IE F12 DevTools debugger, shows the following error:

    SCRIPT5007: Unable to get property '_showFilterMenu' of undefined or null reference<br>File: script block (377), Line: 3, Column: 1

    Do you have any idea how I could fix it?

    My source code follows:

    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" EnableScriptCombine="False" />
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
        <asp:button id="Button1" text="Export to CSV" onclick="ExportToCvs" runat="server" />
        <telerik:RadGrid ID="RadGrid1" Skin="Silk" AutoGenerateColumns="false"
            AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True"
            PageSize="10" OnNeedDataSource="RadGrid1NeedDataSource" EnableLinqExpressions="false" runat="server">
            <ExportSettings HideStructureColumns="true" />
            <MasterTableView Width="100%" AllowFilteringByColumn="True">
                <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
                <Columns>
                    <telerik:GridBoundColumn DataField="Column1" HeaderText="Column1" />
                    <telerik:GridDateTimeColumn DataField="Column2" UniqueName="Column2" HeaderText="Column2"
                        PickerType="DatePicker" EnableRangeFiltering="true" FilterControlWidth="110px"
                        EditDataFormatString="dd.mm.yyyy" DataFormatString="{0:dd/mm/yyyy}" DataType="System.DateTime"
                        ShowFilterIcon="false" CurrentFilterFunction="Between" />
                    <telerik:GridBoundColumn DataField="Column3" HeaderText="Column3" />
                </Columns>
                <ItemStyle BackColor="#DFDFDF" />
                <HeaderStyle BackColor="#FFFFFF" ForeColor="#767676" />
                <AlternatingItemStyle BackColor="#FFFFFF" />
            </MasterTableView>
        </telerik:RadGrid>
    </telerik:RadAjaxPanel>
    </form>

    In the code behind:

    protected void RadGrid1NeedDataSource(object source, GridNeedDataSourceEventArgs e) {
        using (SqlConnection conn = new SqlConnection(Settings.Default.ConnectionString)) {
            DataContext db = new DataContext(conn);
            Table<Item> items = db.GetTable<Item>();
            IEnumerable<Item> query = from x in items select x;
            RadGrid1.DataSource = query.ToList();
        }
    }

  2. Kostadin
    Admin
    Kostadin avatar
    1709 posts

    Posted 21 Apr 2015 Link to this post

    Hi Marco,

    I examined the provided code and as far as I can see it looks correct. Could you please disable the ajax and check whether a server side exception will be thrown when filter the grid or change the page size? Also I would appreciate if you can provide the entire page declaration and the related code behind.

    Regards,
    Kostadin
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jaya
    Jaya avatar
    81 posts
    Member since:
    Mar 2011

    Posted 22 Apr 2015 in reply to Kostadin Link to this post

    Hi

    Admin

    Can you solve this

     http://www.telerik.com/forums/how-to-designed-the-aspx-page-and-open-rad-window

     

Back to Top