or
<telerik:RadGrid ID="CovenantRadGrid" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" CellSpacing="0" DataSourceID="ProjectCovenantListingDataSource" GridLines="None" Skin="Office2007" ClientSettings-EnablePostBackOnRowClick="true" OnPreRender="CovenantRadGrid_PreRender" OnItemCommand="CovenantRadGrid_ItemCommand" AllowAutomaticDeletes="true" OnItemDeleted="CovenantRadGrid_ItemDeleted" OnItemDataBound="CovenantRadGrid_ItemDataBound"> <GroupingSettings CaseSensitive="false" /> <ClientSettings EnableRowHoverStyle="true"> <Selecting AllowRowSelect="True" /> <ClientEvents OnRowClicking="OnRowClicking" OnRowClicked="OnRowClicked" OnCommand="OnRowCommand" /> </ClientSettings>.....var isRowSelected = "false"; function OnRowSelecting(sender, eventArgs) { try { var confirmExit = confirmExitKey; if (confirmExit == "True") { if (isRowSelected == "false") { eventArgs.set_cancel(true); var row = sender; function CallBackFn(arg) { if (arg) { isRowSelected = "true"; row.select(); } } radconfirm('<%= GetGlobalResourceObject("GlobalResources", "E009") %> \n\n<br><br>', CallBackFn, 350, 120, null, 'Discard Changes?'); } } } catch (ex) { } } function OnRowSelected(sender, eventArgs) { //reset the isAddButtonClicked variable isRowSelected = "false"; } var isRowCommandFired = "false"; function OnRowCommand(sender, eventArgs) { try { var itemIndex = itemIndex = eventArgs.get_commandArgument(); if (eventArgs.get_commandName() == "RowClick") { var confirmExit = confirmExitKey; if (confirmExit == "True") { if (isRowCommandFired == "false") { eventArgs.set_cancel(true); var row = sender; function CallBackFn(arg) { if (arg) { isRowCommandFired = "true"; var masterTable = $find("<%= CovenantRadGrid.ClientID %>").get_masterTableView(); masterTable.fireCommand("RowClick", itemIndex); isRowCommandFired = "false"; } } radconfirm('<%= GetGlobalResourceObject("GlobalResources", "E009") %> \n\n<br><br>', CallBackFn, 350, 120, null, 'Discard Changes?'); } } } } catch (ex) { } }

Dim script As String = "<script language='javascript' type='text/javascript'>Sys.Application.add_load(MyRadAlert);</script>"Me.Page.ClientScript.RegisterStartupScript(Me.[GetType](), "", script)<telerik:RadComboBox ID="combo" runat="server" OnItemDataBound="ItemDataBound" AllowCustomText="true" <br> EnableTextSelection="true"<br> EnableEmbeddedBaseStylesheet="true"<br> ChangeTextOnKeyBoardNavigation="true" <br> CollapseAnimation-Type="InCubic" <br> DropDownWidth="298px"<br> EnableScreenBoundaryDetection="true" <br> MarkFirstMatch="true"<br> NoWrap="False" <br> Filter="None"<br> CausesValidation="false"<br> IsCaseSensitive="false" <br> EmptyMessage="--All--"<br> ShowDropDownOnTextboxClick="true" <br> HighlightTemplatedItems="True"<br> EnableLoadOnDemand="True"<br> ShowMoreResultsBox="True"<br> ShowToggleImage="True"<br> EnableVirtualScrolling="True"<br> OnItemsRequested="OnItemRequested"<br> OnClientSelectedIndexChanged="multiSelectedIndexChanged"<br> Height="200px"<br> Width="145px"><br></telerik:RadComboBox>protected void OnItemRequested(object sender, RadComboBoxItemsRequestedEventArgs e)<br> {<br> IList list = DataSourceFunc != null ? DataSourceFunc(e.Text) : new ArrayList();<br> if (GetEmptyItem != null && list.Count > 0)<br> {<br> list.Insert(0,GetEmptyItem());<br> }<br> int itemsPerRequest = ConfigCaller.DropDownPortionSize;<br> int startOffset = e.NumberOfItems;<br> int endOffset = Math.Min(startOffset + itemsPerRequest, list.Count);<br> var data = GetPortion(list, Math.Max(0, startOffset - 1), endOffset - Math.Max(0, startOffset - 1));<br> if (data.Count > 0)<br> {<br> combo.ClearSelection();<br> combo.DataSource = data;<br> combo.DataBind();<br> if (!String.IsNullOrEmpty(EmptyClass) && GetEmptyItem != null)<br> {<br> combo.Items[0].Attributes.Add("style", EmptyClass);<br> }<br> }<br> e.Message = list.Count > 0 ? String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset, list.Count) : "No matches";<br> e.EndOfItems = endOffset == list.Count;<br> <br> }<br><br> private IList GetPortion(IList list, int start, int count)<br> {<br> var result = new ArrayList();<br> for (int index = 0; index < list.Count; index++)<br> {<br> var item = list[index];<br> if (index >= start && index < start + count)<br> {<br> result.Add(item);<br> }<br> }<br> return result;<br> }protected void rgdEthnicityReport_PdfExporting(object sender, Telerik.Web.UI.GridPdfExportingArgs e) { if (isPdfExport) { GeneratePdfDocument(e.RawHTML); } else { Session["HTMLContent"] = e.RawHTML; } }
private void GeneratePdfDocument(string htmlContent)
{
try
{
this.PDF = new Doc();
PDF.Rect.Inset(10, 50);
this.PDF.HtmlOptions.Timeout = 600000;
this.PDF.HtmlOptions.RetryCount = 2;
int pdfID;
PDF.TopDown = true;
pdfID = this.PDF.AddImageHtml(htmlContent);
while (true)
{
if (this.PDF.Chainable(pdfID) == false)
break;
this.PDF.Page = PDF.AddPage();
pdfID = this.PDF.AddImageToChain(pdfID);
}
object pdfObject = this.PDF.GetData();
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.AddHeader("Content-Type", "application/pdf");
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + "Ethnicity Summary Report" + ".pdf");
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.BinaryWrite((byte[])pdfObject);
this.PDF.Clear();
HttpContext.Current.Response.End();
}
catch (EHRExceptions ex)
{
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "excAlert", "$(document).ready(function(){jAlert('" + Utility.ContentFetcher.GetValidationMessage("GREX_1", BOL.Classes.EHRSessions.Culture) + "');});", true);
Utility.MailSender.ExceptionLogger(log, ex.ErrorCode, BOL.Classes.EHRSessions.ClinicId, BOL.Classes.EHRSessions.UserId, ex.Message, ex.GetBaseException());
}
}
protected void rbtnSendMail_Click(object sender, EventArgs e) { if (NeedRedirection || WasSessionEnd()) return; try { isPdfExport = false; this.rgdEthnicityReport.MasterTableView.ExportToPdf(); string Intext = "false"; string letterName = "Ethnicity Summary Report"; RadWindow1.NavigateUrl = "~/Patient/Management/ReportEmailing.aspx"; RadWindow1.NavigateUrl += "?InText=" + Intext + "&LetterName=" + letterName + "&EmailCategory=Report"; RadWindow1.Title = "Ethnicity Summary Report"; RadWindow1.Visible = true; RadWindow1.VisibleOnPageLoad = true; } catch (EHRExceptions ex) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "excAlert", "$(document).ready(function(){jAlert('" + Utility.ContentFetcher.GetValidationMessage("GREX_1", BOL.Classes.EHRSessions.Culture) + "');});", true); Utility.MailSender.ExceptionLogger(log, ex.ErrorCode, BOL.Classes.EHRSessions.ClinicId, BOL.Classes.EHRSessions.UserId, ex.Message, ex.GetBaseException()); } }this.rgdEthnicityReport.MasterTableView.ExportToPdf(); so that pdfexporting event is called and we get RawHtml in the session (due to isPDFExport set to false. I have issue over here, It is not showing our Window for sending email & showing the pdf exported by telerik. I want to suppress this & getonly RawHtml & then execute our code for sending email by showing radwindow. We also tried moving code from send email to pdfexporting block but same issue.
Please suggest how to achieve this.
Thanks.