Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
101 views
Hi everybody,
I have a problem when use javascript. I used:   sender.get_masterTableView().fireCommand("Page", "First") in my code. It work in Firefox or google chorme, but it is not work in internet explore. This is error out of stack space int IE. Have any ideas?
Thanks you very much!
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
 
    function rowSelected(sender, args) {           
         if(args.get_commandName() == "SelectCommand")
    {
        var itemIndexHierarhical = +args.get_commandArgument();       
        var item = args.get_tableView().get_dataItems()[itemIndexHierarhical];
        var name = item.getDataKeyValue("MA_DV");
        Service_Test.Web_TITLE_CHITIET(name);            
    }     
    <%Session["CHILD_MADVIQLY"] = "OK";%>     
    sender.get_masterTableView().fireCommand("Page", "First");
    return false;
    }    
 
      
</script>
</telerik:RadCodeBlock>
<div style="width: 100%; height: 100% ; ">
    <table style="width: 100%; height: 100% ; ">
        <tr style="width: 100%; height: 100%">
            <td style="width:100%; height: 100%">
                <telerik:RadGrid ID="rgdBieu2" runat="server" GridLines="None"  OnCustomAggregate="rgdBieu2_CustomAggregate"
                    AutoGenerateColumns="False" ShowFooter="false" OnItemDataBound="RadGrid2_ItemDataBound"
                    AllowMultiRowSelection="True" Skin="Windows7"
                    onitemcommand="rgdBieu2_ItemCommand" >
                    <MasterTableView DataKeyNames = "HIEN_THI,NONGLAM,TEN_DV,CONGNGH,THUONGNGH,TIEUDUNG,KHAC,CKY,TCONG" NoMasterRecordsText="Không có dữ liệu" AutoGenerateColumns="False"  ClientDataKeyNames="MA_DV" Height="10px" Width="100%" EnableNoRecordsTemplate="true" >
                   
                  <SortExpressions>
                   <telerik:GridSortExpression FieldName="NewOrder" SortOrder="Ascending"/>
                    
                  </SortExpressions>
                     <NoRecordsTemplate>
                                Không có dữ liệu
                    </NoRecordsTemplate>
                     
                    <RowIndicatorColumn Visible="True">
                </RowIndicatorColumn>
                     <Columns>
                            <telerik:GridBoundColumn   HeaderText="Mã đơn vị" DataField="MA_DV" UniqueName="MA_DV" FooterText="Tổng" Visible="false"
                                HeaderStyle-Width="12%">
                                 
                                <HeaderStyle Width="12%" HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Center"  />
                                  <FooterStyle HorizontalAlign="Center" Font-Bold="true"/>
                            </telerik:GridBoundColumn>                        
                            <telerik:GridBoundColumn Visible="false" HeaderText=" " DataField = "TEN_DV">
                                <HeaderStyle  HorizontalAlign="left" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Left"  />
                            </telerik:GridBoundColumn>  
                                
                           <telerik:GridButtonColumn HeaderText="Tên đơn vị" DataTextField = "TEN_DV" UniqueName="TEN_DV" Visible="false"
                                CommandName="SelectCommand">
                                <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Left"  />
                               
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn Visible="false" HeaderText="Tên đơn vị" DataField = "BUTTON">
                                <HeaderStyle  HorizontalAlign="left" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Left"  />
                            </telerik:GridBoundColumn>  
                            <telerik:GridButtonColumn HeaderText="Tên đơn vị" DataTextField = "BUTTON" UniqueName="HIEN_THI" FooterText="Tổng"
                                CommandName="SelectCommand">
                                <HeaderStyle HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Left"  />
                            <FooterStyle HorizontalAlign="left" Font-Bold="true"/>
                            </telerik:GridButtonColumn>
                              <telerik:GridBoundColumn Visible="true" HeaderText="" DataField = "HIEN_THI" UniqueName="HIEN_THI">
                                <HeaderStyle  HorizontalAlign="left" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Left"  />
                            </telerik:GridBoundColumn>  
                             
                    
                        </Columns>
                    </MasterTableView>
                    <ClientSettings  AllowColumnsReorder="false" ReorderColumnsOnClient="true" EnableRowHoverStyle="true" EnablePostBackOnRowClick="false">
                        <Selecting AllowRowSelect="false" />
                        <Scrolling AllowScroll="false" UseStaticHeaders="true" />
                       <ClientEvents OnCommand="rowSelected" />
                    </ClientSettings>
                    <GroupingSettings ShowUnGroupButton="false" />
                </telerik:RadGrid>
            </td>
        </tr>       
    </table>
</div>

Kostadin
Telerik team
 answered on 29 May 2013
1 answer
93 views
Hi,

How to prepend a text before the RibbonBarNumericTextBox content from client side?

Thanks
Ben
Shinu
Top achievements
Rank 2
 answered on 29 May 2013
10 answers
443 views
Hi,

I'm facing problem with rad grid pdf export where after exporting to pdf, data is completely misaligned. Not sure if the table format I'm using inside the item template causing the issue.

<telerik:GridTemplateColumn UniqueName="Symbol">
                    <HeaderTemplate>
                        <asp:Label ID="labelHSymbol" runat="server" Text="Symbol"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table width="70px">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelSymbol" runat="server" Text='<%# Bind("Symbol") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>

If you see the code above, I'm using three rows table format where data is present only for third row, other two rows are empty. During PDF export, third row data is getting shifted to first row and finally that is creating complete misalignment in PDF file.

I tried fixing this alignment issues in OnPDFExporting Event but it didn't work in this scenario, pasted the code below -
Approach-1:
protected void TestGrid_PDFExporting(object sender, GridPdfExportingArgs e)
        {
            foreach (GridHeaderItem headerItem in gridIP.MasterTableView.GetItems(GridItemType.Header))
            {
                headerItem.Style["background-color"] = "Gray";
            }
        }
 
Approach-2:
  protected void TestGrid_PDFExporting(object sender, GridPdfExportingArgs e)
        {
            foreach (GridHeaderItem headerItem in gridIP.MasterTableView.GetItems(GridItemType.Header))
            {
                foreach (TableCell cell in headerItem.Cells)
                {
                    cell.Style["color"] = "#FF00FF";
                }
            }
        }

Please help me to investigate this issue, I'm pasting the entire piece of code below -

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
 
namespace PDFXLDownload
{
    public class MyTestEntity
    {
        public string InvName { get; set; }
        public string ShortName { get; set; }
        public string Status { get; set; }
        public string Symbol { get; set; }
        public string MSRating { get; set; }
        public string NERatio { get; set; }
        public string GERatio { get; set; }
        public string OneQ { get; set; }
        public string YT { get; set; }
        public string OneY { get; set; }
        public string ThreeY { get; set; }
        public string FiveY { get; set; }
        public string TenY { get; set; }
        public string ThreeYR { get; set; }
 
        public static List<MyTestEntity> GetInvestmentPerformanceData()
        {
            List<MyTestEntity> investments = new List<MyTestEntity>
            {
                new MyTestEntity
                
                    InvName = "Test Inv Name 1", ShortName="IA-RT", Status="A",
                    Symbol = "N/A", MSRating="2", NERatio="0.46", GERatio="0.46",
                    OneQ="00.00%", YT="00.00%", OneY="00.00%", ThreeY="00.00%", FiveY="00.00%",
                    TenY="00.00%", ThreeYR="00.00%"
                },
                 new MyTestEntity
                
                    InvName = "Test Inv Name 2", ShortName="IA-YE", Status="C",
                    Symbol = "N/A", MSRating="2", NERatio="0.46", GERatio="0.46",
                    OneQ="00.00%", YT="00.00%", OneY="00.00%", ThreeY="00.00%", FiveY="00.00%",
                    TenY="00.00%", ThreeYR="00.00%"
                },
                 new MyTestEntity
                
                     InvName = "Test Inv Name 3", ShortName="IA-RT", Status="B",
                    Symbol = "N/A", MSRating="3", NERatio="0.46", GERatio="0.46",
                    OneQ="00.00%", YT="00.00%", OneY="00.00%", ThreeY="00.00%", FiveY="00.00%",
                    TenY="00.00%", ThreeYR="00.00%"
                },
                 new MyTestEntity
                
                    InvName = "Test Inv Name 4", ShortName="IA-RT", Status="D",
                    Symbol = "N/A", MSRating="4", NERatio="0.46", GERatio="0.46",
                    OneQ="00.00%", YT="00.00%", OneY="00.00%", ThreeY="00.00%", FiveY="00.00%",
                    TenY="00.00%", ThreeYR="00.00%"
                }
            };
            return investments;
        }
    }
}

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PDFXLDownload.aspx.cs"
    Inherits="PDFXLDownload.PDFXLDownload" %>
 
<%@ 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">
<head runat="server">
    <title></title>
    <link href="Styles/Site.css" rel="stylesheet" type="text/css" />
    <link href="Grid.Default.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableScriptCombine="false">
    </telerik:RadScriptManager>
    <telerik:RadGrid runat="server" ID="gridIP" EnableEmbeddedSkins="false" GridLines="None"
        ShowFooter="false" AllowFilteringByColumn="false" AllowSorting="false" ShowGroupPanel="false"
        AllowPaging="false" OnPdfExporting="TestGrid_PDFExporting">
        <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Bottom">
            <Columns>
                <telerik:GridTemplateColumn UniqueName="InvName">
                    <HeaderTemplate>
                        <asp:Label ID="labelHInvName" runat="server" Text="Inv Name"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table width="200px">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                    <asp:Label ID="label1" runat="server" Text="AC Test Data One"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="label2" runat="server" Text="AC Test Data Two"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelInvName" runat="server" Text='<%# Bind("InvName") %>'></asp:Label>  
                                    <asp:Label ID="labelShortName" runat="server" Text='<%# Bind("ShortName") %>'></asp:Label>  
                                    <asp:Label ID="labelStatus" runat="server" CssClass="FundStatus" Text='<%# Bind("Status") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="Symbol">
                    <HeaderTemplate>
                        <asp:Label ID="labelHSymbol" runat="server" Text="Symbol"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table width="70px">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelSymbol" runat="server" Text='<%# Bind("Symbol") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="MSRating">
                    <HeaderTemplate>
                        <asp:Label ID="labelHMSRating" runat="server" Text="MSRating"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table width="70px">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelMSRating" runat="server" Text='<%# Bind("MSRating") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="NERatio">
                    <HeaderTemplate>
                        <asp:Label ID="labelHNERatio" runat="server" Text="NERatio"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table width="70px">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelNERatio" runat="server" Text='<%# Bind("NERatio") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="GERatio">
                    <HeaderTemplate>
                        <asp:Label ID="labelHGERatio" runat="server" Text="GERatio"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table width="70px">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelGERatio" runat="server" Text='<%# Bind("GERatio") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="OneQ">
                    <HeaderTemplate>
                        <asp:Label ID="labelHOneQ" runat="server" Text="OneQ"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table width="70px">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelOneQ" runat="server" Text='<%# Bind("OneQ") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="YT">
                    <HeaderTemplate>
                        <asp:Label ID="labelHYT" runat="server" Text="YTenure"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table width="70px">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelYT" runat="server" Text='<%# Bind("YT") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="OneY">
                    <HeaderTemplate>
                        <asp:Label ID="labelHOneY" runat="server" Text="OneY"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table width="70px">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelOneY" runat="server" Text='<%# Bind("OneY") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="ThreeY">
                    <HeaderTemplate>
                        <asp:Label ID="labelHThreeY" runat="server" Text="ThreeY"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table width="70px">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelThreeY" runat="server" Text='<%# Bind("ThreeY") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="FiveY">
                    <HeaderTemplate>
                        <asp:Label ID="labelHFiveY" runat="server" Text="FiveY"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table width="70px">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelFiveY" runat="server" Text='<%# Bind("FiveY") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="TenY">
                    <HeaderTemplate>
                        <asp:Label ID="labelHTenY" runat="server" Text="TenY"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table width="70px">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelTenY" runat="server" Text='<%# Bind("TenY") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="ThreeYR">
                    <HeaderTemplate>
                        <asp:Label ID="labelHThreeYR" runat="server" Text="ThreeYR"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table width="70px">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="labelThreeYR" runat="server" Text='<%# Bind("ThreeYR") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
            <CommandItemStyle HorizontalAlign="Left" Wrap="true" Width="100%" />
            <CommandItemTemplate>
                <asp:Label ID="lblText" runat="server" Visible="false" Width="100%"></asp:Label>
            </CommandItemTemplate>
        </MasterTableView>
    </telerik:RadGrid>
    <asp:Button ID="DownloadPDFButton" runat="server" OnClick="DownloadPDFButton_Click"
        Text="Download PDF" Width="184px" />
    <asp:Button ID="DownloadXLButton" runat="server" OnClick="DownloadXLButton_Click"
        Text="Download Exel" Width="157px" />
    </form>
</body>
</html>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.IO;
 
namespace PDFXLDownload
{
    public partial class PDFXLDownload : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            gridIP.DataSource = MyTestEntity.GetInvestmentPerformanceData();
            gridIP.DataBind();
        }
 
        protected void TestGrid_PDFExporting(object sender, GridPdfExportingArgs e)
        {
            string rowHtml = e.RawHTML.ToString();
 
            e.RawHTML = rowHtml.Replace("<td></td>", "<td style=\"height:20px\"></td>");
 
        }
 
        protected void DownloadPDFButton_Click(object sender, EventArgs e)
        {
            gridIP.ExportSettings.OpenInNewWindow = true;
 
            gridIP.ExportSettings.FileName = "PDFExportDemo";
            gridIP.ExportSettings.ExportOnlyData = false;
 
            //Landscape
            gridIP.ExportSettings.Pdf.PageHeight = Unit.Parse("10in");
            gridIP.ExportSettings.Pdf.PageWidth = Unit.Parse("16in");
 
            //// 1/2 inch margins
            gridIP.ExportSettings.Pdf.PageLeftMargin = Unit.Parse("1in");
            gridIP.ExportSettings.Pdf.PageRightMargin = Unit.Parse("1in");
            gridIP.ExportSettings.Pdf.PageTopMargin = Unit.Parse("1in");
            gridIP.ExportSettings.Pdf.PageBottomMargin = Unit.Parse("1in");                     
 
            gridIP.ExportSettings.FileName = "Test Pdf File";
 
            gridIP.MasterTableView.Columns.FindByUniqueName("InvName").HeaderStyle.Width = Unit.Pixel(200);
 
            gridIP.MasterTableView.ExportToPdf();
        }    
 
        protected void DownloadXLButton_Click(object sender, EventArgs e)
        {
            gridIP.ExportSettings.OpenInNewWindow = true;
             
            gridIP.ExportSettings.FileName = "MyTestEntity";
            gridIP.ExportSettings.Excel.FileExtension = "xls";
             
            gridIP.MasterTableView.ExportToExcel();
        }
 
        
    }   
}

                  
Mike
Top achievements
Rank 1
 answered on 29 May 2013
6 answers
328 views
I am able to create an excel attachment by dumping it into a memorystream and attach it to an email. 

However, when I try it as a PDF it doesn't work and throws an error that it's not a supported file type or has been damaged (for example it was sent as an email attachment and wasn't correctly decoded).

I am certain that I did not decode it correctly.  Here is what I have, the export works great, the email attachment does not.

How can I get the PDF into a memory stream to add it as an attachment to an email? 
protected void RadGrid1_PdfExporting(object sender, GridPdfExportingArgs e)
    {     
        StringBuilder customHTML = new StringBuilder();
        // customHTML.Append("<p style='color: red; font-weight: bold; font-size: 11pt;'>Offer Summary</p>");
        customHTML.Append("<table style='font-size: 10px; font-family:Arial Unicode MS;width:500px;'>");
        customHTML.Append("<colgroup><col style='width: 200px; white-space:nowrap;' /><col style='text-align:left;' /></colgroup>");
        // ColGroup = Number of <td> in a row is needed for Telerik export to PDF
        customHTML.Append("<tr><td>Customer: " + LabelCustomerName.Text + "</td><td>Agent: " + LabelAgentName.Text + " </td></tr>");
        customHTML.Append("<tr><td>Customer ID: " + LabelCustomerId.Text + "</td><td>Group ID: " + LabelGroupId.Text + " </td></tr>");
        customHTML.Append("<tr><td>Account Executive: " + LabelAccountExecutive.Text + "</td><td>Credit Status: " + LabelCreditStatus.Text + " </td></tr>");
        customHTML.Append("<tr><td>Account Manager: " + LabelAccountManager.Text + "</td><td>Review Date: " + LabelReviewDate.Text + " </td></tr>");
        customHTML.Append("</table>");
        customHTML.Append("<p></p>");
        e.RawHTML = customHTML + e.RawHTML;
 
        MemoryStream attachmentMemoryStream = new MemoryStream(new ASCIIEncoding().GetBytes(e.RawHTML));
 
        // Test Email
        SmtpClient smtpClient = new SmtpClient(Convert.ToString(ConfigurationManager.AppSettings["SERVER_EMAIL"]));
        string authType = "Basic";
        MailMessage email = new MailMessage();
        StringBuilder body = new StringBuilder();
        string emaURL = Convert.ToString(ConfigurationManager.AppSettings["BASE_URL"]);
        email.From = new MailAddress("someemail@gmail.com");
        email.CC.Add("myemail@gmail.com");
        email.Subject = "File_" + LabelCustomerName.Text + " - " + Convert.ToString(ConfigurationManager.AppSettings["SERVER_NAME"]) + " - Group " + LabelGroupId.Text;
        email.Attachments.Add(new Attachment(attachmentMemoryStream, "File_" + LabelCustomerName.Text + "_" + DateTime.Today.ToShortDateString() + ".pdf"));
        email.Body = body.ToString();
        email.IsBodyHtml = true;
        NetworkCredential nc = new NetworkCredential(RijndaelAlgorithm.Decrypt(Convert.ToString(ConfigurationManager.AppSettings["CredentialU"])), RijndaelAlgorithm.Decrypt(Convert.ToString(ConfigurationManager.AppSettings["CredentialP"])));
        smtpClient.Credentials = nc.GetCredential(Convert.ToString(smtpClient), 25, authType);
        smtpClient.Send(email);
    }
Mike
Top achievements
Rank 1
 answered on 29 May 2013
2 answers
123 views
when I enter 1/1/29 it autocompletes to 1/1/2029 but if I do 1/1/30 I get 1/1/1930
I am using v 2013.1.417.35 - the latest as of 24-May-2013

How can I make it go to 1/1/2030

Alastair
Jenni
Top achievements
Rank 1
 answered on 29 May 2013
1 answer
140 views
Hi

We are currently working on ASP.Net 3.5, Telerik 2011 and almost supporting all browsers except IE 10. We tried to use Telerik 2013 Q1 but we are facing problem in rad grid, few buttons and few css we are seeing different. Do you have any suggestion for us how to go ahead and make this working?

Thanks,
Pradip
Venelin
Telerik team
 answered on 29 May 2013
3 answers
70 views
For lack of a better question, what is the current status of RadEditor with regard to pasting in copied text from Word?  Currently at our shop we're running Office Professional Plus 2010.  (I am not talking about pasting images.  We learned that the hard way.)

I'm afraid I can't be more precise but the problem is that on rare occasions, when a user pastes in text from Word (or apparently Outlook) something gets slightly corrupted and my program doesn't function exactly as I expect.  And of course we're using multiple browsers.

To put it another way, what are the best practices with regard to the Editor settings and searching the content, once saved to a database varchar field?
Niko
Telerik team
 answered on 29 May 2013
1 answer
209 views
I have an application that dynamically builds an HTML table and populates it with data server side. (Why the designer did not us a repeater is food for another thread). I have the ability to change the date, and when i do so, the table is supposed to be re-built with the selected date's content.

Server side, the correct date is being passed, and it builds the table correctly. My AjaxLoadingPanel displays while the request is processing, but when the request completes, the original data is still showing... For the life of me i cannot figure out why.

Here is the requisite code:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="txtDate">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="tblAttendance" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
    <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Metro">
</telerik:RadAjaxLoadingPanel>
<cc1:TabPanel ID="tabAttendance" runat="server" Height="150" HeaderText="Attendance">
                       <ContentTemplate>
                           <asp:Panel runat="server" ID="pnlAttendance" Width="900px">
                               <asp:Table ID="tblAttendance" EnableViewState="False" runat="server" class="ResultsTable"
                                   CellSpacing="0" border="0" Style="width: 880px; border-collapse: collapse;">
                               </asp:Table>
                               <br />
                               <asp:Button ID="btnAttendanceReturn" runat="server" Text="Return" Width="100px" Visible="False"
                                   OnClick="BtnReturnClick" />
                               <asp:Button ID="btnAttendanceSave" runat="server" Text="Save" Width="100px" Visible="False"
                                   OnClick="BtnAttendanceSaveClick" />
                           </asp:Panel>
                       </ContentTemplate>
                   </cc1:TabPanel>
private void GenerateAttendanceTable()
       {
           int counter = 0;
           int notesColWidth = 550;
           const string SRowStyle = "ResultsText";
           const string SRowStyleAlt = "ResultsTextAlt";
           tblAttendance.Rows.Clear();

      .... GET THE DATA .....

foreach(var tableRow in data.Rows)
{
      tblAttendance.Rows.Add(tableRow);
}
Maria Ilieva
Telerik team
 answered on 29 May 2013
1 answer
186 views
I Have rad grid ,In that I have Rad Async upload ,when   user click On edit button of rad grid , i want to dynamically upload the file like ,when user select the click on async upload control ,that mean in rad grid ,I have some records,when user click on ,one record Edit Button
at that time I want ,to Upload same picture to rad Async Upload ,Is any chance to that .

I have idea,when user click on that edit button ,at the time ,we save already display  item in ,rad grid ,It stores ,In Some Download or Some temp folder,at same time ,we call async  upload file functionality Dynamically.upload file ,,

can u plz help in that situation,where we store the file  ,how to dynamically load the file.sample snippet provided to me .

  1.  
    1.    <telerik:GridTemplateColumn Visible="true" DataField="Signature" HeaderText="Signature"
    2.                     HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" UniqueName="Signature">
    3.                     <ItemTemplate>
    4.                         <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" DataValue='<%#Eval("Signature") is DBNull ? null : Eval("Signature")%>'
    5.                             AutoAdjustImageControlSize="false" ResizeMode="Fit" Height="50px" Width="120px" />
    6.                     </ItemTemplate>
    7.                     <InsertItemTemplate>
    8.                         <telerik:RadAsyncUpload runat="server" ID="ImgImages2" AllowedFileExtensions=".jpg,.jpeg,.png,.gif"
    9.                             MaxFileInputsCount="1" Skin="Outlook" Width="350px" PostbackTriggers="PerformInsertButton" />
    10.                         <asp:Label ID="lblupload2" runat="server" Visible="true" CssClass="error"></asp:Label>
    11.                        
    12.                     <EditItemTemplate>
    13.                       
    14.                         <telerik:RadAsyncUpload runat="server" ID="ImgImages" AllowedFileExtensions=".jpg,.jpeg,.png,.gif"
    15.                             MaxFileInputsCount="1" Skin="Outlook" Width="350px" PostbackTriggers="UpdateButton" />
    16.                       
    17.                         <asp:Label ID="lblupload1" runat="server" Visible="true" CssClass="error"></asp:Label>--%>
    18.                     </EditItemTemplate>
    19.                 </telerik:GridTemplateColumn>



             



Hristo Valyavicharski
Telerik team
 answered on 29 May 2013
1 answer
140 views
Hello,

I am currently developing a User Control which contains a RadListView and a RadDataPager. The User Control receives a parameter which is a String representing the Skin to be applied to the Telerik Controls, and the setting is done on 

protected void Page_Load(object sender, EventArgs e)
{
if (Visible == true)
{
this.RadListView_RelevantEvents.Skin = this.Skin;
this.RadDataPager_RadListView_RelevantEvents.Skin = this.Skin;
....
}
}

Nonetheless, only the RadDataPager_RadListView_RelevantEvents gets the skin applied to it whilst RadListView_RelevantEvents inherits the Skin from the Parent element which is a RadDock.

Can someone please provide some help?

Thank you for your attention.

Kind regards,

Kostadin
Telerik team
 answered on 29 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?