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

GridButtonColumn buttons not working after .NET 4.0 upgrade

2 Answers 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Solomon
Top achievements
Rank 1
Solomon asked on 03 Aug 2010, 08:53 PM
I have a RadGrid (along with a RadAjaxManager and RadAjaxLoadingPanel). The version is 2010.1.309.

The grid contains two GridButtonColumns (for edit and delete).  Everything was working fine until I upgraded the website from .NET 3.5 to 4.0. Now when I click on a button, the loading panel shows up for a second, but nothing happens. I can see the code is running on my button event handlers (edit command does a Response.Redirect and the delete command deletes the object). In fact, the object is actually deleted, but I need to refresh the page to see it. If I remove the RadAjaxLoadingPanel, it seems to work ok (but I get another error when trying to page). Any thoughts on this? I don't have access to a newer version, so hopefully there a fix for this version?

Solomon

<asp:panel id="pnlList" runat="server">
    <telerik:radajaxmanager id="radAjaxManager" runat="server">
        <ajaxsettings>
            <telerik:ajaxsetting ajaxcontrolid="radItem">
                <updatedcontrols>
                    <telerik:ajaxupdatedcontrol loadingpanelid="radLoadingPanel" controlid="radItem" />
                </updatedcontrols>
            </telerik:ajaxsetting>
        </ajaxsettings>
    </telerik:radajaxmanager>
    <telerik:radajaxloadingpanel id="radLoadingPanel" runat="server" height="100" width="100" transparency="1">
    </telerik:radajaxloadingpanel>
    <telerik:radgrid width="700px" id="radItem" pagesize="15" runat="server" allowpaging="True" allowsorting="True" gridlines="None" skin="Telerik" autogeneratecolumns="False" onitemcommand="radItem_Command">
        <pagerstyle mode="NextPrevAndNumeric" />
        <mastertableview datakeynames="PersonId">
            <columns>
                <telerik:gridbuttoncolumn text="Edit" commandname="Edit">
                    <itemstyle width="37px" horizontalalign="Center" />
                </telerik:gridbuttoncolumn>
                <telerik:gridbuttoncolumn text="Delete" confirmtext="Are you sure you want to delete this person?" commandname="Delete">
                    <itemstyle width="45px" horizontalalign="Center" />
                </telerik:gridbuttoncolumn>
                <telerik:gridboundcolumn uniquename="column" headertext="Name" datafield="Name">
                </telerik:gridboundcolumn>
                <telerik:gridboundcolumn uniquename="column" headertext="Title" datafield="Name">
                </telerik:gridboundcolumn>
                <telerik:gridboundcolumn uniquename="column" headertext="Date" datafield="Date">
                </telerik:gridboundcolumn>
            </columns>
        </mastertableview>
    </telerik:radgrid>
    <p>
        <asp:linkbutton id="lnkExportToExcel" runat="server" onclick="lnkExportToExcel_Click">Export List To Excel</asp:linkbutton><br />
        <asp:linkbutton id="lnkExportToWord" runat="server" onclick="lnkExportToWord_Click">Export List To Word</asp:linkbutton>
    </p>
</asp:panel>

protected void radItem_Command(object source, GridCommandEventArgs e)
{
    if (!(e.Item is GridDataItem)) return;
 
    var dataItem = (GridDataItem) e.Item;
    string id = dataItem.GetDataKeyValue("PersonId").ToString();
 
    if (e.CommandName == "Edit")
    {
        Response.Redirect(string.Format("person.aspx?id={0}", id));
    }
    if (e.CommandName == "Delete")
    {
        _personHelper.Delete(_sessionHelper.GetPersonById(Convert.ToInt32(id)));
 
        Response.Redirect("person.aspx");
    }
}

2 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 06 Aug 2010, 01:30 PM
Hello Solomon,

Are you by any chance using RadComression? There is an issue in .Net 4.0 which prevents our module from working as expected when the page is redirected. We've implemented a workaround in later versions, however the one you are using is suffering from this issue. If this is the case you can either use the Redirect() method of RadAjaxManager instead. Let me know if that helps or if your problem is different.

Sincerely yours,
Pavel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Solomon
Top achievements
Rank 1
answered on 10 Aug 2010, 06:23 AM
I was using RadCompression and disabling it worked like a charm. Thanks!

Sol
Tags
Grid
Asked by
Solomon
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Solomon
Top achievements
Rank 1
Share this question
or