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

modalpopupextender does not work from Radgrid

1 Answer 34 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Ahmed asked on 07 Sep 2015, 11:02 AM

hello, I have a radgrid with a linkbutton column "Edit". I want to call a modalextenderpopup when a user clicks the Edit button using Javascript. But it is not working:

<telerik:RadGrid ID="RadGrid_Search" runat="server" AllowPaging="True"
            AllowSorting="True" GroupPanelPosition="Top"  PageSize="30"
        ResolvedRenderMode="Classic" HorizontalAlign="Right"
            <MasterTableView Width="100%"  DataKeyNames="UPC">
                <PopUpSettings Modal="true"/>
            <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete" ConfirmText="AA"></telerik:GridButtonColumn>
            <telerik:GridButtonColumn UniqueName="EditColumn" Text="Edit" CommandName="Select" ></telerik:GridButtonColumn>
                <Selecting AllowRowSelect="True" />
            <HeaderStyle Font-Bold="True" Font-Names="Verdana" />
            <ItemStyle Font-Names="Verdana" />
<cc1:ModalPopupExtender ID="popup" BehaviorID="popup1" runat="server" DropShadow="false"
        PopupControlID="pnlAddEdit" TargetControlID="lnkDummy" BackgroundCssClass="modalBackground" OkControlID="btnYes" >

Code Behind:
if (e.Item is GridDataItem)
            GridDataItem dataItem = e.Item as GridDataItem;
            string contactName = dataItem["Album Name"].Text;
            LinkButton button = dataItem["DeleteColumn"].Controls[0] as LinkButton;
            button.Attributes["onclick"] = "return confirm('Are you sure you want to delete " +
            contactName + "?')";
            LinkButton btnEdit = dataItem["EditColumn"].Controls[0] as LinkButton;
            btnEdit.Attributes["onclick"] = "return ShowModalPopup()";

Javascript code :
function ShowModalPopup() {
           catch (err) {
           return false;

Please advice. Thank you

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 10 Sep 2015, 07:28 AM
Hello Ahmed,

I am afraid using Telerik controls together with AjaxControlToolkit is currently not supported:

You can use RadWindow with enabled Modal property:

Hope this helps.

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 Feedback Portal and vote to affect the priority of the items
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question