This is a migrated thread and some comments may be shown as answers.

Editor Does not display correct on first hit

7 Answers 174 Views
Editor
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 01 Jun 2010, 08:26 PM
I have a faily complex layout that uses a RadGrid nested in a RadPane. I then have a CommandButton on the RadGrid rows, this button sets the visibility of the grid to false as well as setting a asp panel to visible. The panel contains a RadEditor. When the button is pressed the first time the editor does not show up correctly. You can refresh the page or hit the command button again and every hit after that it will display properly.

There is an ajax request happening that shows the grid. Screenshots of the problem and the correct output are attached.

Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InvoicePreviewException.aspx.cs" Inherits="SalesManagementWebApplication.Executive.Report.PreviewBacklog.InvoicePreviewException" MasterPageFile="~/SalesManagementMaster.Master" %> 
 
<asp:Content ID="ContentPlaceHolderHead" ContentPlaceHolderID="ContentPlaceHolderHead" runat="server">  
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxyPage" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadGridSearch">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadSplitterPageContent" LoadingPanelID="RadAjaxLoadingPanelReport" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="ButtonSearch">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGridSearch" LoadingPanelID="RadAjaxLoadingPanelReport" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="PanelEmailSales">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadSplitterPageContent" LoadingPanelID="RadAjaxLoadingPanelReport" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 
</asp:Content> 
 
<asp:Content ID="ContentPlaceHolderBody" ContentPlaceHolderID="ContentPlaceHolderBody" runat="server">  
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelReport" runat="server" Skin="Simple" /> 
    <telerik:RadSplitter ID="RadSplitterPageContent" runat="server" Orientation="Horizontal" BorderSize="0" BorderStyle="None" BorderWidth="0">  
        <telerik:RadPane ID="RadPaneWebSearchForm" runat="server" Scrolling="None" Height="30">  
            <table class="searchTable">  
                <tr> 
                    <th title="Select the starting date.">  
                        <asp:Label ID="LabelFromDate" runat="server" Text="From:" AssociatedControlID="RadDatePickerFrom" /> 
                    </th> 
                    <td title="Select the starting date.">  
                        <telerik:RadDatePicker ID="RadDatePickerFrom" runat="server" Width="90px" /> 
                    </td> 
                    <th title="Select the ending date.">  
                        <asp:Label ID="LabelToDate" runat="server" Text="To:" AssociatedControlID="RadDatePickerTo" /> 
                    </th> 
                    <td title="Select the ending date.">  
                        <telerik:RadDatePicker ID="RadDatePickerTo" runat="server" Width="90px" /> 
                    </td> 
                    <th title="Enter an Invoice Number, or partial Invoice Number here to limit the results by Invoice Number, seperate multiple Invoice Number's by commas." nowrap> 
                        <asp:Label ID="LabelInvoiceNumber" runat="server" Text="Invoice #:" AssociatedControlID="RadTextBoxInvoiceNumber" /> 
                    </th> 
                    <td title="Enter an Invoice Number, or partial Invoice Number here to limit the results by Invoice Number, seperate multiple Invoice Number's by commas.">  
                        <telerik:RadTextBox ID="RadTextBoxInvoiceNumber" runat="server" Width="150px" /> 
                    </td> 
                    <th title="When 'Show' is 'All' all invoices will be displayed, when either 'Gold Standard Exceptions' or 'Replacement Cost Exceptions' is selected ONLY invoices with line items with a GM% less than the PL threshold will be displayed.">  
                        <telerik:RadComboBox ID="RadComboBoxShowExceptions" runat="server" Width="150px" Label="Show:">  
                            <Items> 
                                <telerik:RadComboBoxItem Value="all" Text="All" Selected="true" /> 
                                <telerik:RadComboBoxItem Value="gs" Text="Gold Standard Exceptions" /> 
                                <telerik:RadComboBoxItem Value="rc" Text="Replacement Cost Exceptions" /> 
                            </Items> 
                        </telerik:RadComboBox> 
                    </th> 
                    <th> 
                        <telerik:RadComboBox ID="RadComboBoxExpanded" runat="server" CssClass="smallMargin" Label="Expanded:" Width="50px" Text="Test:">  
                            <Items> 
                                <telerik:RadComboBoxItem Value="true" Text="Yes" Selected="true" /> 
                                <telerik:RadComboBoxItem Value="false" Text="No" /> 
                            </Items> 
                        </telerik:RadComboBox> 
                    </th> 
                    <td title="Click the search button to execute a new search.">  
                        <asp:Button ID="ButtonSearch" runat="server" Text="Search" OnClick="ButtonSearch_Click" /> 
                    </td> 
                </tr> 
            </table> 
        </telerik:RadPane> 
        <telerik:RadPane ID="RadPaneWebSearchResult" runat="server" Scrolling="None" CssClass="RadPaneScrollingPane">  
            <telerik:RadGrid SkinId="noCommandItemTemplate" 
                ID="RadGridSearch" 
                runat="server"   
                DataSourceID="ObjectDataSourceSearch" 
                OnItemCommand="RadGridSearch_ItemCommand" 
                AllowMultiRowSelection="true" onitemdatabound="RadGridSearch_ItemDataBound">  
                <MasterTableView DataKeyNames="InvoiceNumber" Name="MainTable">  
                    <Columns> 
                        <telerik:GridButtonColumn ButtonType="ImageButton" DataTextField="InvoiceNumber" CommandName="Email" HeaderStyle-Width="20" ImageUrl="~/Image/i_email.gif" /> 
                        <telerik:GridBoundColumn HeaderText="Invoice Date" DataField="InvoiceDate" UniqueName="InvoiceDate" SortExpression="InvoiceDate" ShowFilterIcon="true" ItemStyle-Wrap="false" DataFormatString="{0:d}" HeaderStyle-Width="110" /> 
                        <telerik:GridBoundColumn HeaderText="Sales Order Number" DataField="SalesOrderNumber" UniqueName="SalesOrderNumber" SortExpression="SalesOrderNumber" ShowFilterIcon="true" ItemStyle-Wrap="false" HeaderStyle-Width="110" /> 
                        <telerik:GridBoundColumn HeaderText="Invoice Number" DataField="InvoiceNumber" UniqueName="InvoiceNumber" SortExpression="InvoiceNumber" ShowFilterIcon="true" ItemStyle-Wrap="false" HeaderStyle-Width="110" /> 
                        <telerik:GridBoundColumn HeaderText="Territory" DataField="SalesmanId" UniqueName="SalesmanId" SortExpression="SalesmanId" ShowFilterIcon="true" ItemStyle-Wrap="false" HeaderStyle-Width="110" /> 
                        <telerik:GridBoundColumn HeaderText="AR" DataField="AR" UniqueName="AR" SortExpression="AR" ShowFilterIcon="true" ItemStyle-Wrap="false" HeaderStyle-Width="110" /> 
                        <telerik:GridBoundColumn HeaderText="Customer Name" DataField="CustomerName" UniqueName="CustomerName" SortExpression="CustomerName" ShowFilterIcon="true" ItemStyle-Wrap="false" HeaderStyle-Width="250" /> 
                        <telerik:GridBoundColumn HeaderText="Bill To State" DataField="State" UniqueName="State" SortExpression="State" ShowFilterIcon="true" ItemStyle-Wrap="false" HeaderStyle-Width="110" /> 
                        <telerik:GridBoundColumn HeaderText="Total Sale" DataField="TotalSaleAmount" UniqueName="TotalSaleAmount" SortExpression="TotalSaleAmount" ShowFilterIcon="true" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:c}" HeaderStyle-Width="110" /> 
                        <telerik:GridBoundColumn HeaderText="Freight Paid" DataField="FreightPaid" UniqueName="FreightPaid" SortExpression="FreightPaid" ShowFilterIcon="true" ItemStyle-Wrap="false" HeaderStyle-Width="110" DataType="System.Boolean" /> 
                        <telerik:GridCalculatedColumn HeaderText="GM after Freight" UniqueName="GmAfterFreight" DataType="System.Decimal" DataFields="TotalCost, TotalSaleAmount, FreightAmount" Expression="iif({1}=0,0,({1}-{0}-{2})/{1})"  SortExpression="GmAfterFreight" ShowFilterIcon="true" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:p2}" HeaderStyle-Width="110" /> 
                        <%--   
                        <telerik:GridBoundColumn HeaderText="TotalCost" DataField="TotalCost" UniqueName="TotalCost" SortExpression="TotalCost" ShowFilterIcon="true" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:c}" HeaderStyle-Width="110" /> 
                        <telerik:GridBoundColumn HeaderText="Freight" DataField="FreightAmount" UniqueName="FreightAmount" SortExpression="FreightAmount" ShowFilterIcon="true" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:c}" HeaderStyle-Width="110" /> 
                        --%> 
                    </Columns> 
                    <DetailTables> 
                        <telerik:GridTableView runat="server" Name="LineItems" DataSourceID="ObjectDataSourceLineItems" DataKeyNames="InvoiceNumber" Height="100%" EnableHeaderContextFilterMenu="true">  
                            <ParentTableRelation> 
                                <telerik:GridRelationFields DetailKeyField="InvoiceNumber" MasterKeyField="InvoiceNumber" /> 
                            </ParentTableRelation> 
                            <Columns> 
                                <telerik:GridBoundColumn HeaderText="PartNumber" DataField="PartNumber" UniqueName="PartNumber" SortExpression="PartNumber" ItemStyle-Wrap="false" /> 
                                <telerik:GridBoundColumn HeaderText="Product Line" DataField="ProductLineId" UniqueName="ProductLineId" SortExpression="ProductLineId" ItemStyle-Wrap="false" /> 
                                <telerik:GridBoundColumn HeaderText="Description" DataField="Description" UniqueName="Description" SortExpression="Description" ItemStyle-Wrap="false" /> 
                                <telerik:GridBoundColumn HeaderText="Qty Ordered" DataField="QuantityOrdered" UniqueName="QuantityOrdered" SortExpression="QuantityOrdered" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" /> 
                                <telerik:GridBoundColumn HeaderText="Qty Shipped" DataField="QuantityShipped" UniqueName="QuantityShipped" SortExpression="QuantityShipped" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" /> 
                                <telerik:GridBoundColumn HeaderText="Sales Price" DataField="SalesPrice" UniqueName="SalesPrice" SortExpression="SalesPrice" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:c}" /> 
                                <telerik:GridBoundColumn HeaderText="Extended Sales Amount" DataField="ExtendedSalesAmount" UniqueName="ExtendedSalesAmount" SortExpression="ExtendedSalesAmount" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:c}" /> 
                                <telerik:GridBoundColumn HeaderText="Gold Standard" DataField="GoldStandard" UniqueName="GoldStandard" SortExpression="GoldStandard" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:c}" /> 
                                <telerik:GridBoundColumn HeaderText="Replacement Cost" DataField="ReplacementCost" UniqueName="ReplacementCost" SortExpression="ReplacementCost" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:c}" /> 
                                <telerik:GridCalculatedColumn HeaderText="GM% @ GS" UniqueName="GmPercentAtGoldStandard" DataType="System.Decimal" DataFields="GoldStandard, SalesPrice" Expression="iif({1}=0,0,({1}-{0})/{1})"  SortExpression="GmPercentAtGoldStandard" ShowFilterIcon="true" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:p2}" /> 
                                <telerik:GridBoundColumn HeaderText="GM% @ GS Threshold" DataField="GoldStandardThreshold" UniqueName="GoldStandardThreshold" SortExpression="GoldStandardThreshold" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:p}" Visible="false" /> 
                                <telerik:GridCalculatedColumn HeaderText="GM% @ RC" UniqueName="GmPercentAtRC" DataType="System.Decimal" DataFields="ReplacementCost, SalesPrice" Expression="iif({1}=0,0,({1}-{0})/{1})"  SortExpression="GmPercentAtRC" ShowFilterIcon="true" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:p2}" /> 
                                <telerik:GridBoundColumn HeaderText="GM% @ RC Threshold" DataField="ReplacementCostThreshold" UniqueName="ReplacementCostThreshold" SortExpression="ReplacementCostThreshold" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:p}" Visible="false" /> 
                            </Columns> 
                        </telerik:GridTableView> 
                    </DetailTables> 
                    <CommandItemTemplate> 
                        <table class="layout" cellpadding="0" cellspacing="0">  
                            <tr> 
                                <td valign="middle" style="padding-top: 3px;">  
                                    <asp:ImageButton ID="ImageButtonExcelExport" runat="server" ImageUrl="~/Image/i_excel.gif" OnClick="ImageButtonExcelExport_Click" CssClass="smallMargin" /> 
                                </td> 
                                <td valign="middle">  
                                    <asp:Button ID="ButtonViewSelected" runat="server" Text="View Selected" OnClick="ButtonViewSelected_Click" /> 
                                </td> 
                            </tr> 
                        </table> 
                    </CommandItemTemplate> 
                    <SortExpressions>   
                        <telerik:GridSortExpression FieldName="InvoiceDate" SortOrder="Ascending" />   
                    </SortExpressions> 
                </MasterTableView> 
                <ClientSettings EnableRowHoverStyle="true">  
                    <Selecting AllowRowSelect="True" /> 
                </ClientSettings> 
            </telerik:RadGrid> 
 
            <asp:Panel ID="PanelEmailSales" runat="server" Visible="false" DefaultButton="ButtonEmailSalesCancel">  
                <asp:HiddenField ID="HiddenFieldInvoiceNumber" runat="server" /> 
                <table class="inlineFormTable">  
                    <caption> 
                        Send   
                        <asp:Label ID="LabelMailSalespersonName" runat="server" Text="" /> 
                        email concerning invoice number   
                        <asp:Label ID="LabelMailInvoiceNumber" runat="server" Text="" /> 
                    </caption> 
                    <tr> 
                        <td style="padding: 2px;">  
                            <telerik:RadEditor ID="RadEditorEmailBody" runat="server" Height="400" width="600" EditModes="Design" EnableResize="false" CssClass="">  
                                <Tools> 
                                    <telerik:EditorToolGroup> 
                                        <telerik:EditorTool Name="Bold" /> 
                                        <telerik:EditorTool Name="Italic" /> 
                                        <telerik:EditorTool Name="Underline" /> 
                                        <telerik:EditorTool Name="StrikeThrough" /> 
                                        <telerik:EditorSplitButton Name="SplitCell" /> 
                                        <telerik:EditorTool Name="JustifyLeft" /> 
                                        <telerik:EditorTool Name="JustifyCenter" /> 
                                        <telerik:EditorTool Name="JustifyRight" /> 
                                        <telerik:EditorTool Name="JustifyFull" /> 
                                        <telerik:EditorTool Name="JustifyNone" /> 
                                        <telerik:EditorSplitButton Name="SplitCell" /> 
                                        <telerik:EditorTool Name="Indent" /> 
                                        <telerik:EditorTool Name="Outdent" /> 
                                        <telerik:EditorSplitButton Name="SplitCell" /> 
                                        <telerik:EditorTool Name="InsertOrderedList" /> 
                                        <telerik:EditorTool Name="InsertUnorderedList" /> 
                                    </telerik:EditorToolGroup> 
                                </Tools> 
                            </telerik:RadEditor> 
                        </td> 
                    </tr> 
                    <tr class="buttonRow">  
                        <td> 
                            <asp:Button ID="ButtonEmailSend" runat="server" Text="Send" onclick="ButtonEmailSend_Click" /> 
                            <asp:Button ID="ButtonEmailSalesCancel" runat="server" Text="Cancel" onclick="ButtonEmailSalesCancel_Click" /> 
                        </td> 
                    </tr> 
                </table> 
            </asp:Panel> 
        </telerik:RadPane> 
    </telerik:RadSplitter> 
 
    <asp:ObjectDataSource   
        ID="ObjectDataSourceSearch"   
        runat="server"   
        TypeName="ServiceWebClassLibrary.MARCOMV.MVFILE.INVFTServiceWeb"   
        SelectMethod="LoadExecutiveInvoicePreviewException"   
        EnableCaching="false"   
        CacheDuration="42000">  
        <SelectParameters> 
            <asp:ControlParameter ControlID="RadDatePickerFrom" Name="from" Type="DateTime" /> 
            <asp:ControlParameter ControlID="RadDatePickerTo" Name="to" Type="DateTime" /> 
            <asp:ControlParameter ControlID="RadTextBoxInvoiceNumber" Name="InvoiceNumber" Type="String" /> 
            <asp:ControlParameter ControlID="RadComboBoxShowExceptions" Name="ShowExceptions" Type="String" PropertyName="SelectedValue" /> 
        </SelectParameters> 
    </asp:ObjectDataSource> 
    <asp:ObjectDataSource   
        ID="ObjectDataSourceLineItems"   
        runat="server"   
        TypeName="ServiceWebClassLibrary.MARCOMV.MVFILE.INVFTServiceWeb"   
        SelectMethod="LoadExecutiveInvoicePreviewExceptionLineItems"   
        EnableCaching="true"   
        CacheDuration="42000">  
        <SelectParameters> 
            <asp:SessionParameter Name="InvoiceNumber" SessionField="InvoiceNumber" Type="string" /> 
        </SelectParameters> 
    </asp:ObjectDataSource> 
</asp:Content> 


Code behind:
using System;  
using Telerik.Web.UI;  
using FoundationClassLibrary.Web;  
using FoundationClassLibrary.Data;  
using System.Net.Mail;  
using CacheProxyClassMarcoMvNamespace.MVFILE;  
using ServiceWebClassLibrary.MARCOMV.MVFILE;  
using System.Data;  
using System.Configuration;  
 
namespace SalesManagementWebApplication.Executive.Report.PreviewBacklog  
{  
    public partial class InvoicePreviewException : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {
            #region turn off scrolling on RadPanel  
            RadPane contentPane = (RadPane)Master.FindControl("RadPaneContentHere");  
            contentPane.Scrolling = SplitterPaneScrolling.None;
            #endregion  
 
            #region make sure datasource doesn't select on non-postback  
            if (!Page.IsPostBack)  
                RadGridSearch.DataSourceID = "";  
            else if (string.IsNullOrEmpty(RadGridSearch.DataSourceID))  
                RadGridSearch.DataSourceID = "ObjectDataSourceSearch";
            #endregion  
 
            #region reduce page size when items are all expanded  
            if (RadComboBoxExpanded.SelectedValue == "true" && RadGridSearch.PageSize > 50)  
            {  
                RadGridSearch.PageSize = 50;  
            }
            #endregion  
        }
        #region button handlers  
        protected void ButtonSearch_Click(object sender, EventArgs e)  
        {  
            RadGridSearch.MasterTableView.HierarchyDefaultExpanded = StringFormatter.ToBool(RadComboBoxExpanded.SelectedValue);  
        }  
 
        protected void ImageButtonExcelExport_Click(object sender, System.Web.UI.ImageClickEventArgs e)  
        {  
            RadGridSearch.MasterTableView.HierarchyDefaultExpanded = StringFormatter.ToBool(RadComboBoxExpanded.SelectedValue);  
 
            RadGridSearch.Rebind();  
            RadGridSearch.MasterTableView.ExportToExcel();  
        }  
 
        protected void ButtonViewSelected_Click(object sender, EventArgs e)  
        {  
            RadGridSearch.MasterTableView.HierarchyDefaultExpanded = StringFormatter.ToBool(RadComboBoxExpanded.SelectedValue);  
 
            string filterString = string.Empty;  
            foreach (GridDataItem item in RadGridSearch.SelectedItems)  
            {  
                //Select invoice numbers out of selected rows, ignore rows selected with no InvoiceNumbers  
                string invoiceNumber = string.Empty;  
                try 
                {  
                    invoiceNumber = item["InvoiceNumber"].Text;  
                }  
                catch 
                {  
                    invoiceNumber = string.Empty;  
                }  
 
                if (!string.IsNullOrEmpty(invoiceNumber))  
                    filterString += String.Format("{0},", invoiceNumber);  
            }  
 
            //Trim off the extra , and rebind only if there is a filterString  
            if (!string.IsNullOrEmpty(filterString))  
            {  
                filterString = StringFormatter.Left(filterString, filterString.Length - 1);  
 
                RadTextBoxInvoiceNumber.Text = filterString;  
 
                RadGridSearch.Rebind();  
            }  
        }
        #endregion  
 
        #region email functionality  
        protected void RadGridSearch_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)  
        {  
            if (e.CommandName == "Email")  
            {  
                GridDataItem item = (GridDataItem)e.Item;  
                string invoiceNumber = item["InvoiceNumber"].Text;  
 
 
                //Populate form ------------------------------------  
                //Load data  
                DataSet invoiceDataSet = INVFTServiceWeb.LoadExecutiveInvoicePreviewException(DateTime.MinValue, DateTime.MinValue, invoiceNumber, "all");  
 
                //DataSet invoiceLineItemsDataSet = INVFTServiceWeb.LoadExecutiveInvoicePreviewExceptionLineItems(invoiceNumber);  
 
                TMSUSERXREF tms = TMSUSERXREFServiceWeb.Load(ObjectFormatter.ToString(invoiceDataSet.Tables[0].Rows[0]["SalesmanId"]));  
                BAIUSER user = BAIUSERServiceWeb.Load(tms.LogonUser);  
                  
                //Set values on form  
                HiddenFieldInvoiceNumber.Value = invoiceNumber;  
                LabelMailSalespersonName.Text = user.PersonName;  
                LabelMailInvoiceNumber.Text = invoiceNumber;  
 
                //make form visible  
                SetEmailFormVisible(true);  
            }  
        }  
 
        protected void ButtonEmailSalesCancel_Click(object sender, EventArgs e)  
        {  
            //Reset form state  
            SetEmailFormVisible(false);  
        }  
 
        protected void ButtonEmailSend_Click(object sender, EventArgs e)  
        {  
            //Get data ---------------------------------------------------------------------------------------------------  
            string invoiceNumber = HiddenFieldInvoiceNumber.Value;  
 
            DataSet invoiceDataSet = INVFTServiceWeb.LoadExecutiveInvoicePreviewException(DateTime.MinValue, DateTime.MinValue, invoiceNumber, "all");  
            DataSet invoiceLineItemsDataSet = INVFTServiceWeb.LoadExecutiveInvoicePreviewExceptionLineItems(invoiceNumber);  
 
            TMSUSERXREF tms = TMSUSERXREFServiceWeb.Load(ObjectFormatter.ToString(invoiceDataSet.Tables[0].Rows[0]["SalesmanId"]));  
            BAIUSER user = BAIUSERServiceWeb.Load(tms.LogonUser);  
 
            //Build Message -------------------------------------------------------------------------------------------  
            MailMessage mail = new MailMessage();  
            mail.IsBodyHtml = true;  
 
            mail.To.Add(new MailAddress(String.Format("{0}@{1}", user.AdLoginName, ConfigurationManager.AppSettings["EmailDomain"])));  
            mail.Bcc.Add(new MailAddress("jglaser@marcousa.com"));  
 
            mail.From = new MailAddress(String.Format("{0}@{1}", ConfigurationManager.AppSettings["AdminUserName"], ConfigurationManager.AppSettings["EmailDomain"]));  
 
            mail.Subject = String.Format("Invoice Exception: {0}", invoiceNumber);  
 
            mail.Body = RadEditorEmailBody.Content;  
 
            //Add on invoice info  
            mail.Body += "<hr>";  
            mail.Body += String.Format("<b>Invoice Number:</b> {0}<br>", invoiceNumber);  
            mail.Body += String.Format("<b>AR:</b> {0} <b>Name:</b> {1}<br>", ObjectFormatter.ToString(invoiceDataSet.Tables[0].Rows[0]["AR"]), ObjectFormatter.ToString(invoiceDataSet.Tables[0].Rows[0]["CustomerName"]));  
            mail.Body += String.Format("<b>Invoice Date:</b> {0:d}<br>", invoiceDataSet.Tables[0].Rows[0]["InvoiceDate"]);  
            mail.Body += String.Format("<b>Total Sale</b>: {0:c}<br>", invoiceDataSet.Tables[0].Rows[0]["TotalSaleAmount"]);  
 
            if (invoiceLineItemsDataSet.Tables[0].Rows.Count > 0)  
            {  
                mail.Body += "<table>";  
                mail.Body += "<caption>Line Items</caption>";  
 
 
                mail.Body += "<tr>";  
                mail.Body += "<th>Part Number</th><th>Description</th><th>Qty Ordered</th><th>Qty Shipped</th><th>Sales Price</th><th>Extended Sales Price</th>";  
                mail.Body += "</tr>";  
                //Line items here  
                foreach (DataRow row in invoiceLineItemsDataSet.Tables[0].Rows)  
                {  
                    mail.Body += "<tr>";  
                    mail.Body += String.Format("<td>{0}</td>", ObjectFormatter.ToString(row["PartNumber"]));  
                    mail.Body += String.Format("<td>{0}</td>", ObjectFormatter.ToString(row["Description"]));  
                    mail.Body += String.Format("<td align=\"right\">{0}</td>", ObjectFormatter.ToString(row["QuantityOrdered"]));  
                    mail.Body += String.Format("<td align=\"right\">{0}</td>", ObjectFormatter.ToString(row["QuantityShipped"]));  
                    mail.Body += String.Format("<td align=\"right\">{0:c}</td>", row["SalesPrice"]);  
                    mail.Body += String.Format("<td align=\"right\">{0:c}</td>", row["ExtendedSalesAmount"]);  
                    mail.Body += "</tr>";  
                }  
 
                mail.Body += "</table>";  
 
                  
            }  
 
            //Send email --------------------------------------------------------------------------------------------------------------------  
            SmtpClient client = new SmtpClient(ConfigurationManager.AppSettings["SMTPServer"]);  
            client.Send(mail);  
 
            //Reset form state -----------------------------------------------------------------------------------------------------------------------  
            SetEmailFormVisible(false);  
        }  
 
        void SetEmailFormVisible(bool visible)  
        {  
            if (visible)  
            {  
                PanelEmailSales.Visible = true;  
                RadGridSearch.Visible = false;  
                ButtonSearch.Enabled = false;  
            }  
            else 
            {  
                PanelEmailSales.Visible = false;  
                RadGridSearch.Visible = true;  
                ButtonSearch.Enabled = true;  
 
                //Reset values  
                HiddenFieldInvoiceNumber.Value = string.Empty;  
                RadEditorEmailBody.Content = string.Empty;  
            }  
        }
        #endregion  
 
        protected void RadGridSearch_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridDataItem && e.Item.OwnerTableView.Name == "LineItems")  
            {  
                if (RadComboBoxShowExceptions.SelectedValue == "gs")  
                {  
                    GridDataItem item = (GridDataItem)e.Item;  
                    string rawGsPercent = item["GmPercentAtGoldStandard"].Text;  
                    string rawGsThPercent = item["GoldStandardThreshold"].Text;  
                    decimal gsPercent = StringFormatter.ToDecimal(rawGsPercent.Replace(" %"string.Empty));  
                    decimal gsThPercent = StringFormatter.ToDecimal(rawGsThPercent.Replace(" %"string.Empty));  
 
                    if (gsPercent < gsThPercent)  
                        item.ForeColor = System.Drawing.Color.Red;  
                }  
                else if (RadComboBoxShowExceptions.SelectedValue == "rc")  
                {  
                    GridDataItem item = (GridDataItem)e.Item;  
                    string rawRcPercent = item["GmPercentAtRC"].Text;  
                    string rawRcThPercent = item["ReplacementCostThreshold"].Text;  
                    decimal rcPercent = StringFormatter.ToDecimal(rawRcPercent.Replace(" %"string.Empty));  
                    decimal rcThPercent = StringFormatter.ToDecimal(rawRcThPercent.Replace(" %"string.Empty));  
 
                    if (rcPercent < rcThPercent)  
                        item.ForeColor = System.Drawing.Color.Red;  
                }  
            }    
 
        }  
 
 
    }  
}  
 


Clearly this behavior is undesirable. Any assistance would be greatly appriciated.

7 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 04 Jun 2010, 12:10 PM
Hi James,

Could you please register the external RadEditor skins as it is shown in this KB article: Registering an external skin of RadEditor?

You can also take advantage of the recently introduced CDN support which will allow you to load the controls skins from the Telerik CDN. Telerik CDN is hosted on the Amazon CloudFront service.

You can find more information about our CDN support here and here.

By loading the external or CDN skins you will ensure that the editor will load its skin.

Best wishes,
Dobromir
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
James
Top achievements
Rank 1
answered on 08 Jun 2010, 09:13 PM
Dobromir,

I have registered the external skins as you have suggested to try, but this does not resolve my issue.

Do you have any other suggestions?
0
Dobromir
Telerik team
answered on 14 Jun 2010, 08:53 AM
Hi James,

Could you please open a support ticket and provide a sample runnable project so we can investigate it further?

Best wishes,
Dobromir
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Roger
Top achievements
Rank 1
answered on 22 Dec 2010, 03:39 PM
Was there a resolve for this issue, I'm having the same type issue.

Radeditor doesn't display correctly on initial load.
0
James
Top achievements
Rank 1
answered on 22 Dec 2010, 10:16 PM
I never did reach a solution. The problem wasn't big enough for us to prepare a sample to send in. When we get back around to the project I will likely reraise the issue. If you happen to find a solution please post it here.
0
Roger Barnes
Top achievements
Rank 1
answered on 28 Dec 2010, 03:03 PM
James, since I didn't get a response on this thread from Telerik, I started a new one,

http://www.telerik.com/community/forums/aspnet-ajax/editor/379456-editor-does-not-display-correct-on-first-hit.aspx

I did find a way to get around this, see my other thread.  If you create your own custom tools file, it seems to work.

Hope it helps

Roger
0
Rumen
Telerik team
answered on 30 Dec 2010, 01:50 PM
Hi Roger,


The problem is really odd and it could be due to some xml tag or attribute in the Default ToolsFile.xml file.
Can you please compare the default and your custom toolsfile xml files with WinMerge or another diff tool and see whether there are some special attributes or tags that is causing the problem?


All the best,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Editor
Asked by
James
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
James
Top achievements
Rank 1
Roger
Top achievements
Rank 1
Roger Barnes
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or