This is a migrated thread and some comments may be shown as answers.
Open Pdf on click on Template column
4 Answers 12 Views
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 10 Apr 2014, 02:34 PM
I want open one pdf window on click of that Id.

How to open pdf in new window

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 11 Apr 2014, 07:09 AM
Hi Rahul,

Please take a look at the below sample code snippet to open a PDF in RadWindow:

ASPX:
<telerik:GridTemplateColumn HeaderText="OpenPDF">
  <ItemTemplate>
   <asp:Button ID="btnOpenWnd" runat="server" Text="Open Window" OnClientClick="Open(); return false;" />     
  </ItemTemplate>
</telerik:GridTemplateColumn>
 . . . . . . . . .
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    <Windows>
        <telerik:RadWindow ID="RadWindowPDF" runat="server" NavigateUrl="~/RadGridExport.pdf">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

JS:
<script type="text/javascript">
  function Open() {
     window.radopen("RadGridExport.pdf", "RadWindowPDF");
    }
</script>

Thanks,
Princy
0
Rahul
Top achievements
Rank 1
answered on 18 Apr 2014, 02:39 PM
I want to open on ItemCommand event ..

When i click on llink button, i am calling database fuction it will return pdffile path. I want to open window from code behind on linkbutton click.

Please help.
0
Princy
Top achievements
Rank 1
answered on 21 Apr 2014, 06:34 AM
Hi Rahul,

Please try the following code snippet to open the window from code behind.

ASPX:
<asp:Button ID="btnOpenWnd" runat="server" Text="Open Window" CommandName="OpenPDF" />

C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
  if (e.CommandName == "OpenPDF")
  {
    string script = "function f(){Open(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
  }
}

Thanks,
Princy
0
JOSE LUIZ TORDINO
Top achievements
Rank 1
answered on 09 Apr 2018, 03:43 PM

I don´t understand your sample.

Where should I insert the files name ?

Tags
Grid
Asked by
Rahul
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Rahul
Top achievements
Rank 1
JOSE LUIZ TORDINO
Top achievements
Rank 1
Share this question
or