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

modalpopupextender does not work from Radgrid

1 Answer 17 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ahmed
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"
            ondeletecommand="RadGrid_Search_DeleteCommand"
        onitemdatabound="RadGrid_Search_ItemDataBound"
        oneditcommand="RadGrid_Search_EditCommand">
            <MasterTableView Width="100%"  DataKeyNames="UPC">
            <EditFormSettings>
                <PopUpSettings Modal="true"/>
            </EditFormSettings>
            <Columns>
            <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete" ConfirmText="AA"></telerik:GridButtonColumn>
            <telerik:GridButtonColumn UniqueName="EditColumn" Text="Edit" CommandName="Select" ></telerik:GridButtonColumn>
            </Columns>
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
            <HeaderStyle Font-Bold="True" Font-Names="Verdana" />
            <ItemStyle Font-Names="Verdana" />
                                  
        </telerik:RadGrid>
 
<cc1:ModalPopupExtender ID="popup" BehaviorID="popup1" runat="server" DropShadow="false"
        PopupControlID="pnlAddEdit" TargetControlID="lnkDummy" BackgroundCssClass="modalBackground" OkControlID="btnYes" >
    </cc1:ModalPopupExtender>

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() {
           try
           {
               $find("popup1").show();               
           }
           catch (err) {
               alert(err.message);
           }
           return false;
       }


Please advice. Thank you

1 Answer, 1 is accepted

Sort by
0
Eyup
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:
http://www.telerik.com/forums/telerik-ui-for-asp-net-ajax-and-ajax-control-toolkit

You can use RadWindow with enabled Modal property:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window


Hope this helps.

Regards,
Eyup
Telerik
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
Tags
Grid
Asked by
Ahmed
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or