or
01.Private Sub RadGrid1_GridExporting(sender As Object, e As GridExportingArgs) Handles RadGrid1.GridExporting02. 03. If isLoc <> True Then04. 05. Dim ms As New MemoryStream(New UTF8Encoding().GetBytes(e.ExportOutput))06. 07. Dim smtpClient As New SmtpClient()08. smtpClient.EnableSsl = True09. 10. Dim mailMessage As New MailMessage()11. mailMessage.IsBodyHtml = True12. mailMessage.[To].Add(New MailAddress(Session("Email")))13. mailMessage.Subject = "Reporting service - Do Not reply"14. mailMessage.Body = "This report was sent from <br /><b>Reporting service</b> "15. mailMessage.Attachments.Add(New Attachment(ms, "Reporting service" & DocType))16. Try17. smtpClient.Send(mailMessage)18. 'Label1.Text = "Message Sent" 19. MsgBox("Message Sent")20. Catch ex As Exception21. 'Label1.Text = ex.ToString()22. MsgBox("Message not Sent")23. End Try24. 25. Response.Redirect(Request.Url.ToString())26. 27. 28. 29. End If30.End Sub| <script type="text/javascript" language="javascript"> |
| function Export() { |
| var masterTable = $find('RadGrid1').get_masterTableView(); |
| if (masterTable != null) |
| masterTable.exportToExcel(); |
| } |
| </script> |
| <telerik:RadGrid ID="RadGrid1" ShowStatusBar="True" Height="360px" |
| runat="server" AutoGenerateColumns="False" AllowSorting="false" |
| GridLines="None" ShowFooter="false" EnableDrag="false" |
| OnNeedDataSource="RadGrid1_NeedDataSource" ExportSettings-FileName="NostroTransfer" |
| OnItemDataBound="RadGrid1_ItemDataBound"> |

<telerik:RadGrid ID="dgEscrow" runat="server" GridLines="None" EnableEmbeddedSkins="false" AutoGenerateColumns="false" ShowFooter="true" CssClass="esGridTable"> <HeaderStyle Font-Bold="true" HorizontalAlign="Center" /> <ClientSettings> <ClientEvents OnGridCreated="setScrollerDimensionsEscrow" /> <Scrolling AllowScroll="true" SaveScrollPosition="true" /> </ClientSettings></telerik:RadGrid>Public Sub BindDG(Optional ByVal isPrintPage As Boolean = False) Dim edt As New EscrowDataTable(TractGID) Dim dt As DataTable = edt.GetDataTable Dim dv As DataView = dt.DefaultView With dgEscrow .CellSpacing = 0 .ItemStyle.CssClass = "esGridRow" .AlternatingItemStyle.CssClass = "esGridRow" End With dgEscrow.DataSource = dv dgEscrow.DataBind() End Sub