RadGridComparisonLines.ExportSettings.IgnorePaging =
true;
RadGridComparisonLines.ExportSettings.Pdf.AllowPrinting =
true;
RadGridComparisonLines.ExportSettings.Pdf.PageLeftMargin =
Unit.Pixel(10);
RadGridComparisonLines.ExportSettings.Pdf.PageRightMargin =
Unit.Pixel(10);
RadGridComparisonLines.ExportSettings.ExportOnlyData =
false;
RadGridComparisonLines.MasterTableView.ExportToPdf();
I need a function like the ShowAlert button in this demo
http://demos1x.telerik.com/aspnet/Window/Examples/BrowserDialogBoxes/DefaultCS.aspx
However instead of invoking a popup window by a button click, as in the demo, I want to invoke the popup window inside an IF statement in the code behind of a user control.
After the user clicks "Yes" or "Cancel" the value of this user selection needs to be returned to the IF statement in the code behind.
In other words, I need almost the same thing as the demo except the modal popup window needs to be triggered in the code behind instead of by the user clicking on a button.
More specifically, I am using a RadUpload. After the user selects (browses for) a file, I check the filename. If the name is non-standard I want a modal popup to warn the user and ask if the user wants to proceed.
protected void buttonUpload_Click(object sender, EventArgs e)
{
FileNameType fileType = (FileNameType)Enum.Parse(typeof(FileNameType), RadComboBoxUploadType.SelectedValue);
foreach (UploadedFile file in RadUploadSCS.UploadedFiles)
{
string mg = msgFileOK(file.FileName, RadComboBoxUploadType.SelectedItem.Text);
if (mg.Length > 0)
...Here I want to popup the window and get a yes/cancel response back from the user
| <asp:Button ID="btnSubmitChanges" runat="server" Text="Submit Changes, New Term and/or Comments" OnClick="SubmitChanges" OnClientClick="return blockConfirm('<p><strong><u>WARNING!</u></strong></p><p>More text</p>', event, 650, 200,'','Submit Changes');" Width="300px" /> |
| <telerik:RadDatePicker |
| DateInput-ClientEvents-OnKeyPress="keyPressed_textbox" |
| TabIndex="5" |
| runat="server" |
| ID="datepickerDob" |
| Width="180px" |
| MinDate="1/1/1900" |
| CssClass="body_copy" /> |
| function keyPressed_textbox(sender, args) { |
| debugger; |
| if ( 13 == args.get_keyCode() ) { |
| /* never gets here for RadDatePicker's DateInput OnKeyPress event */ |
| } |
| } |
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="login" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" > |
| <head runat="server"> |
| <title>Login</title> |
| <script type="text/javascript" src="scripts/jquery-1.3.2.min.js"></script> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All" ControlsToSkip="Fieldset" /> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" EnableAJAX="true"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="Login1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="Login1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <fieldset id="fieldsetlogin"> |
| <legend></legend> |
| <asp:Login ID="Login1" runat="server" DestinationPageUrl="~/test.aspx" FailureText="<div class='error'>Invalid Login!</div>" OnAuthenticate="Login1_Authenticate"> |
| <LayoutTemplate> |
| <br /> |
| <table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse"> |
| <tr> |
| <td> |
| <table border="0" cellpadding="3"> |
| <tr> |
| <td align="center" colspan="3"> |
| <span class="bold gray">Please enter your login information.</span> |
| </td> |
| </tr> |
| <tr> |
| <td align="center" colspan="3"> |
| <asp:Literal ID="FailureText" runat="server" EnableViewState="False" Text=" "></asp:Literal> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" CssClass="loginLabel" Width="100px">User Name:</asp:Label></td> |
| <td> |
| <asp:TextBox ID="UserName" runat="server" Width="225px"></asp:TextBox></td> |
| <td> |
| <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator></td> |
| </tr> |
| <tr> |
| <td> |
| <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" CssClass="loginLabel" Width="100px">Password:</asp:Label></td> |
| <td> |
| <asp:TextBox ID="Password" runat="server" TextMode="Password" Width="225px"></asp:TextBox></td> |
| <td> |
| <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator></td> |
| </tr> |
| <tr> |
| <td align="right" colspan="2"> |
| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" IsSticky="true" runat="server" Skin="WebBlue" Visible="true" Transparency="30" Height="35px" BackgroundPosition="Center" EnableAjaxSkinRendering="true"> |
| </telerik:RadAjaxLoadingPanel> |
| <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Sign In" ValidationGroup="Login1" /> |
| </td> |
| <td> </td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| </LayoutTemplate> |
| </asp:Login> |
| </fieldset> |
| </form> |
| </body> |
| </html> |