Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
344 views
If possible, how can I set the viewpaths property for the imagemanager in the Radeditor dynamically? I need to set this based on something like a TempData variable. I tried ...

 RadEditor_HTMLSource.ImageManager.ViewPaths = (String[])TempData["mykey"];

But it's not set.

Thanks
Matt
Matt
Top achievements
Rank 1
 answered on 30 Dec 2010
4 answers
150 views
Hello - I have a scenario where a random number of .jpg files get placed in a folder and my web page's responsibility is to simply display, in slide-show format, those images. Having not used either the RadRotator or RadSlider controls, I'm a bit confused about which direction to take. The demo's I've seen for the Slider control seem to be geared around those scenarios where the number of images to be displayed is fixed, whereas the Rotator is better suited for a situation like mine, where the images can be changed frequently.

Ideally, I'd like to be able to simply "point" the control at the directory that contains the images and it would automatically display everything in that path as a slideshow. I'm able to accomplish this with the Ajax Control toolkit. Is this possible with either the RadSlider or RadRotator? Thanks.

Matt
Matt Low
Top achievements
Rank 1
 answered on 30 Dec 2010
4 answers
168 views
I have a page with a RadGrid (auto generated columns). I want to store how the user is setting their column sizes in Personalization so that it automatically reloads the column sizes each time they load the page/grid.

In order to do this I need to be able to (after a postback of some sort) retrieve the size (pixels) of the columns, but whenever I loop through the GridBoundColumns ItemStyle widths to get the value it is always blank.

How would I be able to get the width of the columns after a postback or partial postback?
Raddy Rad
Top achievements
Rank 1
 answered on 30 Dec 2010
2 answers
104 views
Telerik Devs and Experts,

I have 2 RadMenus on one page and both are wrapped in a usercontrols and for some reason for menu #2 the submenu items will not display... don't really know where to start with this one.  Please help.
Kevon Hayes
Top achievements
Rank 1
 answered on 30 Dec 2010
1 answer
48 views
We have a very strange problem, with sorting not working in  RadGrid. The problem is, it should work!

We have two very similar web applications, both set up in the same way getting data via an Object Data Source (an Extended Object Data Source to be exact). In one of the application, setting the AllowSorting=true works perfectly fine without any problems at all, in the other application, it seem to work, even the RadGrid itself seem to think it is working (processing, taking some time, showing the loading panel etc. etc. etc.) but it doesn't! The order or the rows never change. Everything else like filtering, even custom filtering, works 100%. Sorting expressions etc are in both applications generated by the RadGrid itself from the Data Source, and should be correct.

We have done exactly as described here:
http://www.telerik.com/help/aspnet-ajax/grdbasicsorting.html

If nothing had happended, that would have been one thing, but now it seems like the RadGrid is actually doing some kind of sorting, just that we never get to see the results. We really need some ideas here on what could be wrong, because as we see it, the way we are doing it should be correct, and it works fine in one application, but not the other.

Please advice :)
Marin
Telerik team
 answered on 30 Dec 2010
2 answers
226 views
Hi,

I'm using a RadComboBox which, via a DataSource, is populated with a list of monetary values, i.e. 50, 100, 1,000, 2,000. We need to sort the list from low to high, but because the 'value' of each option is not the same as the text, we need to sort it by text, however, the list is being sorted as strings, rather than as numbers, so anything beginning with a '1' is listed before anything beginning with a '2', i.e. 100, 1,000, 2,000, 50 etc. Is there are way to resolve this so that the text is treated as numeric? We are unable to alter the DataSource.

Here is my code:

.ASCX:
<telerik:RadComboBox runat="server" ID="cbMoney" AutoPostBack="false" width="200px" DataSourceID="MoneyDataSource" DataTextField="Descr" DataValueField="CodeValue" Sort="Ascending"></telerik:RadComboBox>

.ASCX.VB:
Protected Sub cbMoney _DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbMoney.DataBound
   
cbMoney.Items.Sort()
End Sub

Thanks in advance,

Hugh
hugh
Top achievements
Rank 1
 answered on 30 Dec 2010
1 answer
98 views
Hi,

I need the dropPosition (like I could request in the nodeDropping event from the eventArgs) already in the nodeDragging event.

The issue is that I can sort nodes within the tree (drag them in between) and certain nodes (determined by an attribute value) may be moved everywhere BUT to the first position (under certain parent nodes with the same attribute value).

I could simply cancel the dropping event - but that would confuse the user: All other checks are done in nodeDragging and if the drop target is invalid the not-allowed cursor style is displayed. This should also be the case when this certain node type is dragged directly under the certain parent nodes if this has no other children or above the first child of these parents.

So how can I determine the current dropPosition in the dragging event?
Sebastian P.R. Gingter
Top achievements
Rank 2
 answered on 30 Dec 2010
8 answers
309 views
Hi ,

I have 2 asp .net Dropdowns Country and state with autopostback=true.

I have added controls in asp .net update panel with content template.

As like below...

 <asp:UpdatePanel ID="updateapnel1" runat="server">
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="ddlcountry" EventName="SelectedIndexChanged" />
    <asp:AsyncPostBackTrigger ControlID="ddlstate" EventName="SelectedIndexChanged" />    
    </Triggers>
       <ContentTemplate>
Controls are here [Have a Rad captcha in this form]
</ContentTemplate>
 </asp:UpdatePanel>

Getting New images during the item selection change in dropdown...

can you please tell how to eliminate the rad capcha refresh...

Thanks in advance..
Thenmozhi.R
Lini
Telerik team
 answered on 30 Dec 2010
5 answers
207 views
Good morning,

We are developing an application built of some "RadPanes". Top one holds the title. Below, we have a RadMenu, with some options, like File-->New, Edit,.... This pane's height is just the menu´s height. Below this pane, we have another pane with a grid.

The problem is that, when we expand an option of the pane, the suboptions are not seen, as they are behind the grid's pane. It's not a fact of the grid, as we have tried removing it, but of the pane itself. It seems like the menu cannot expand over other pane. We have also tried several options with z-index, but nothing worked.

Do you know if menu cannot expand in this scenario? Any workaround is appreciated.

Thank you very much,

Jesus
Kevon Hayes
Top achievements
Rank 1
 answered on 30 Dec 2010
7 answers
174 views
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.
Rumen
Telerik team
 answered on 30 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?