Exporting Grid on client through a context menu

3 posts, 1 answers
  1. Dwayne
    Dwayne avatar
    41 posts
    Member since:
    Jun 2009

    Posted 30 Aug 2009 Link to this post

    I am trying to export a grid on the client by using a context menu.  The grid has an ajax manager on it so when I click the export option it starts an ajax request and never does the export.   When i used a button i would  have this code in place to stop the request.


    if (args.get_eventTarget().indexOf("DownloadPDF") > 0)





    but the export option is part of the context menu the event target is the grid.
    I am trying to find a way to detect that the context menu was fired and the value while  canceling the ajax requests on the grid for  those values and fire the ajax on others.

    you have to stop the request on the ajax manager  like this





    I just need to find how to find child controls of the requesting event

  2. Dwayne
    Dwayne avatar
    41 posts
    Member since:
    Jun 2009

    Posted 31 Aug 2009 Link to this post

    I  have figured out how to do this on the server  iniating the  request on the client by call


    var ajaxManager = $find("ctl00_MainSubContent_RADGRID1_RadAjaxManager1");







    'ctl00$MainSubContent$Page$ExcelButton', '');

    but the issue with this is the buttons that you call must be visible on the page usless the request goes nowhere so now i'm left with a context menu that can download Word ,Excel,Pdf but i also have 3 buttons hanging out ont he page which i don't want.

     Iam trying to figure out how to kill the ajax request on the grid when certain context menu selections are selected and to use ajax when other are clicked.

    this is my context menu



    <telerik:RadContextMenu ID="RadMenu1" runat="server" OnClientItemClicked="getWindow" Skin="Black" CssClass="contextmenu">








    <telerik:RadMenuItem Text="Modify"> 










     <telerik:RadMenuItem Text="Add"   />





     <telerik:RadMenuItem Text="Edit"   />















    <telerik:RadMenuItem Text="Medical"  />





    <telerik:RadMenuItem Text="Personel Details" />





    <telerik:RadMenuItem Text="Certificates"  />





     <telerik:RadMenuItem Text="Issued Items" />





     <telerik:RadMenuItem Text="Export To">










      <telerik:RadMenuItem Text="Word"     Value="Word" />





     <telerik:RadMenuItem Text="Excel" Value="Excel" />





    <telerik:RadMenuItem Text="Pdf" Value="Pdf" />




























    the getwindow methods does various thing based on the menu selection





  3. Answer
    Sebastian avatar
    9934 posts

    Posted 02 Sep 2009 Link to this post

    Hello Dwayne,

    I think that the last projects posted in the code library entry here can help you disable the ajax  and export the grid content only when certain items in the context menu are clicked.

    Best regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top