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

RadGrid: some buttons and filters not working

2 Answers 220 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 1
Marco asked on 16 Apr 2015, 11:51 AM

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 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 21 Apr 2015, 06:14 AM
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.

 
0
Jaya
Top achievements
Rank 1
answered on 22 Apr 2015, 06:18 AM

Hi

Admin

Can you solve this

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

 

Tags
Grid
Asked by
Marco
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Jaya
Top achievements
Rank 1
Share this question
or