Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
185 views
I have an Appointment that has a variable size(depending between the start date and end date). I also have some text that was displayed from my RadScheduler Appointment Template. I want to have my text to fit always each of my Appointments size. Can it be done and if so how? An example or some detail please, i'm not expert with RadScheduler. TIP_PROGRAMARE,TIP_APARATURA,TIP_STERILIZARE,NUME_ECHIPAMENT,NUME_OPERATIE is part of my RadScheduler CustomAttributeNames. Please help and thank you for your time and advice.

My Appointment Template is:

                    <AppointmentTemplate>
                        <div style="font-style: italic; width: 100%">
                            Subiect:
                            <%# Eval("Subject") %></div>
                        <div style="font-style: italic; width: 100%;">
                            Tip Programare:
                            <%# Eval("TIP_PROGRAMARE")%></div>
                        <div style="font-style: italic; width: 100%">
                            Tip Sterilizare:
                            <%# Eval("TIP_STERILIZARE")%></div>
                        <div style="font-style: italic; width: 100%">
                            Tip Aparatura:
                            <%# Eval("TIP_APARATURA")%></div>
                        <div style="font-style: italic; width: 100%">
                            Tip Echipament/Sala:
                            <%# Eval("NUME_ECHIPAMENT")%></div>
                        <div style="font-style: italic; width: 100%">
                            Operatia:
                            <%# Eval("NUME_OPERATIE")%></div>
                    </AppointmentTemplate>
Tofan
Top achievements
Rank 1
 answered on 14 Feb 2014
3 answers
115 views
Hi All,
             I am exporting Grid and Child grid inside it it is working fine  for excel but child grid is not exporting in word format . please let me know what I am doing wrong .  My code is 

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/.master" AutoEventWireup="true"
    CodeFile="Sample.aspx.cs" Inherits="Sample"
    EnableEventValidation="false" MaintainScrollPositionOnPostback="true" EnableViewState="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder_Content" runat="Server">
    <telerik:RadCodeBlock ID="RadCodeBlock" runat="server">
        <script type="text/javascript">
            var setScrollPosistion = true;
            var top = 0;
            function DisableAjax(eventTarget, eventArgument) {
                $find('<%=RadAjaxManager.GetCurrent(Page).ClientID %>').__doPostBack(eventTarget, eventArgument);
            }
         
            function RefreshsampleRadGrid() {
                setScrollPosistion = false;
                var radMgr = $find('<%=RadAjaxManager.GetCurrent(Page).ClientID %>');
                radMgr.ajaxRequest("sampleRadGrid");
                return false;
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManagerProxy ID="radAjaxManagerProxy" runat="server">
    </telerik:RadAjaxManagerProxy>
    <telerik:RadSplitter ID="splitterMain" runat="server">
        
        <telerik:RadSplitBar ID="RadSplitBar" runat="server">
        </telerik:RadSplitBar>
        <telerik:RadPane ID="SampleBottomRadPane" runat="server" >
            <telerik:RadDockLayout ID="SAmpleRadDockLayout" runat="server" >
                <asp:Label ID="MessageLabel" runat="server" ></asp:Label>
                <telerik:RadDockZone BStyle="None" ID="SampleRadDockZone" runat="server">
                    <telerik:RadDock ID="RadDock" runat="server" OnCommand="RadDock_Command">
                        <TitlebarTemplate>
                            <table class="RadDockTitlebarTemplateTableClass">
                                <tr>
                                    <td>
                                        <asp:Label ID="DetailTitleLabel" runat="server"/>
                                    </td>
                                </tr>
                            </table>
                        </TitlebarTemplate>
                        
                        <Commands>
                            <telerik:DockExpandCollapseCommand />
                            <telerik:DockCommand Text="Save Position" AutoPostBack="true" />
                        </Commands>
                    </telerik:RadDock>
                    <telerik:RadDock ID="SampleRadDock" runat="server" OnCommand="RadDock_Command">
                        <TitlebarTemplate>
                            <table class="RadDockTitlebarTemplateTableClass">
                                <tr>
                                    <td>
                                        <asp:Label ID="TitleLabel" runat="server" Text="Text"/>
                                    </td>
                                </tr>
                            </table>
                        </TitlebarTemplate>
                        <ContentTemplate>
                            <asp:Panel ID="SearchPanel" runat="server" Width="99.4%">
                              
                                <div class="RadGridHorizontalScroll" style="overflow: auto;">
                                    <table width="115%">
                                        <tr>
                                            <td style="white-space: nowrap">
                                                <asp:LinkButton ID="ExpandCollapseAllLinkButton" runat="server" Text="Expand/Collapse All"
                                                    OnClick="ExpandCollapseAllLinkButton_Click" 
                                                    Enabled="false"></asp:LinkButton>
                                                &nbsp; &nbsp; &nbsp;
                                                <asp:Label ID="TotalLabel" runat="server" Text=" Total:" ></asp:Label>
                                                <asp:Label ID="TotalValueLabel" runat="server" ></asp:Label>
                                                &nbsp; &nbsp; &nbsp;
                                                <asp:Label ID="AvailableLabel" runat="server" Text="PO Available:" ></asp:Label>
                                                <asp:Label ID="AvailableValueLabel" runat="server" ></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <telerik:RadGrid ID="sampleRadGrid" runat="server" OnItemCreated="sampleRadGrid_ItemCreated" OnExcelMLExportRowCreated="sampleRadGrid_ExcelMLExportRowCreated"
                                                    OnNeedDataSource="sampleRadGrid_NeedDataSource" ShowFooter="true" FooterStyle-Wrap="false"
                                                    OnItemDataBound="sampleRadGrid_ItemDataBound" OnDetailTableDataBind="sampleRadGrid_DetailTableDataBind" MasterTableView-ShowGroupFooter="true">
                                                    <ExportSettings Excel-Format="ExcelML"/>
                                                    <MasterTableView CommandItemDisplay="Top" DataKeyNames="ID,dueAmt,Qty"
                                                        HierarchyDefaultExpanded="false" HierarchyLoadMode="Client" TableLayout="Fixed" ShowGroupFooter="true">
                                                        <ExpandCollapseColumn Visible="False">
                                                        </ExpandCollapseColumn>
                                                        <RowIndicatorColumn Visible="False">
                                                            <HeaderStyle Width="20px" />
                                                        </RowIndicatorColumn>
                                                        <GroupFooterTemplate>
                                                            <table width="100%">
                                                                <tr>
                                                                    <td style="white-space: nowrap">
                                                                        <asp:Label runat="server" ID="SubTotalLabel" Text=" Average:"></asp:Label>
                                                                    </td>
                                                                    <td>
                                                                        <telerik:RadNumericTextBox runat="server" ID="TotalRadNumericTextBox" ReadOnly="true"
                                                                            Width="100px" EnabledStyle-HorizontalAlign="Right" NumberFormat-DecimalDigits="3" CssClass="AlignedRadNumericTextBox">
                                                                        </telerik:RadNumericTextBox>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="white-space: nowrap">
                                                                        <asp:Label runat="server" ID="Label" Text=":"></asp:Label>
                                                                    </td>
                                                                    <td>
                                                                        <telerik:RadNumericTextBox runat="server" ID="RadNumericTextBox" ReadOnly="true"
                                                                            Width="100px" EnabledStyle-HorizontalAlign="Right" NumberFormat-DecimalDigits="3" CssClass="AlignedRadNumericTextBox">
                                                                        </telerik:RadNumericTextBox>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="white-space: nowrap">
                                                                        <asp:Label runat="server" ID="TaxesLabel" Text="Taxes:"></asp:Label>
                                                                    </td>
                                                                    <td>
                                                                        <telerik:RadNumericTextBox runat="server" ID="TaxesRadNumericTextBox" ReadOnly="true"
                                                                            Width="100px" EnabledStyle-HorizontalAlign="Right" NumberFormat-DecimalDigits="3" CssClass="AlignedRadNumericTextBox">
                                                                        </telerik:RadNumericTextBox>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="2">
                                                                        <hr />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="white-space: nowrap">
                                                                        <asp:Label runat="server" ID="TotalLabel" Text=" Total:"></asp:Label>
                                                                    </td>
                                                                    <td>
                                                                        <telerik:RadNumericTextBox runat="server" ID="subTotalRadNumericTextBox" ReadOnly="true"
                                                                            Width="100px" EnabledStyle-HorizontalAlign="Right" NumberFormat-DecimalDigits="2" CssClass="AlignedRadNumericTextBox">
                                                                        </telerik:RadNumericTextBox>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </GroupFooterTemplate>
                                                        <CommandItemTemplate>
                                                            <table width="100%">
                                                                <tr>
                                                                    <td align="left">
                                                                        <asp:Image ID="ItemImage" runat="server" ></asp:Image>&nbsp;&nbsp;
                                                                        <asp:HyperLink ID="ItemHyperLink" runat="server" >Add New Item</asp:HyperLink>
                                                                    </td>
                                                                    <td class="ExportButtonIconSaperator" style="width: 2%">
                                                                        <asp:ImageButton ID="ExportToExcelImageButton"  Style="margin-right: 0px;"
                                                                            runat="server" OnClick="ExportToExcelImageButton_Click" />
                                                                    </td>
                                                                    <td class="ExportButtonIconSaperator" style="width: 2%">
                                                                        <asp:ImageButton ID="ExportToWordImageButton" 
                                                                            runat="server" OnClick="ExportToWordImageButton_Click" />
                                                                    </td>
                                                                    <td class="ExportButtonIconSaperator" style="width: 2%">
                                                                        <asp:ImageButton ID="ExportToCsvImageButton" 
                                                                            runat="server" OnClick="ExportToCsvImageButton_Click" />
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </CommandItemTemplate>
                                                        <Columns>
                                                            <telerik:GridTemplateColumn UniqueName="TemplateEditDeleteColumn" HeaderText="Action">
                                                                <HeaderStyle Wrap="false" Width="60px" />
                                                                <ItemStyle Wrap="false" />
                                                                <ItemTemplate>
                                                                    <asp:HyperLink ID="ItemHyperLink" runat="server" Text="Edit" ></asp:HyperLink>
                                                                    &nbsp;&nbsp;
                                                                    <asp:HyperLink ID="CancelHyperLink" runat="server" Text="Cancel" ></asp:HyperLink>
                                                                </ItemTemplate>
                                                            </telerik:GridTemplateColumn>
                                                            <telerik:GridBoundColumn DataField="Reference" HeaderText="Line Item">
                                                                <HeaderStyle Wrap="false" Width="80px" />
                                                                <ItemStyle Wrap="true" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="Number" HeaderText="Number">
                                                                <HeaderStyle Wrap="false" Width="110px" />
                                                                <ItemStyle Wrap="true" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="Name" HeaderText="Name">
                                                                <HeaderStyle Wrap="false" Width="110px" />
                                                                <ItemStyle Wrap="true" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="Qty" HeaderText="Qty">
                                                                <HeaderStyle Wrap="false" Width="80px" />
                                                                <ItemStyle Wrap="true" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="Unit" HeaderText="Unit">
                                                                <HeaderStyle Wrap="false" Width="50px" />
                                                                <ItemStyle Wrap="true" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="UnitPrice" HeaderText="Unit Price" DataFormatString="{0:0.000}" FooterStyle-HorizontalAlign="Right" FooterAggregateFormatString="{0:0.000}">
                                                                <HeaderStyle Wrap="false" Width="80px" />
                                                                <ItemStyle Wrap="false" HorizontalAlign="Right" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridTemplateColumn HeaderText="Average" UniqueName="Average" SortExpression="Subtotal" FooterStyle-HorizontalAlign="Right" FooterAggregateFormatString="{0:0.000}">
                                                                <HeaderStyle Wrap="false" Width="230px" />
                                                                <ItemStyle Wrap="false" HorizontalAlign="Right" />
                                                                <ItemTemplate>
                                                                    <asp:Label runat="server" ID="SubtotalLabel" Text='<%#Eval("Subtotal") %>'></asp:Label>
                                                                </ItemTemplate>
                                                                <FooterTemplate>
                                                                    <table width="100%">
                                                                        <tr>
                                                                            <td style="white-space: nowrap">
                                                                                <asp:Label runat="server" ID="SubTotalLabel" Text=" Average:"></asp:Label>
                                                                            </td>
                                                                            <td>
                                                                                <telerik:RadNumericTextBox runat="server" ID="TotalRadNumericTextBox" ReadOnly="true"
                                                                                    Width="100px" EnabledStyle-HorizontalAlign="Right" NumberFormat-DecimalDigits="3" CssClass="AlignedRadNumericTextBox">
                                                                                </telerik:RadNumericTextBox>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td style="white-space: nowrap">
                                                                                <asp:Label runat="server" ID="Label" Text=":"></asp:Label>
                                                                            </td>
                                                                            <td>
                                                                                <telerik:RadNumericTextBox runat="server" ID="ShippingRadNumericTextBox" ReadOnly="true"
                                                                                    Width="100px" EnabledStyle-HorizontalAlign="Right" NumberFormat-DecimalDigits="3" CssClass="AlignedRadNumericTextBox">
                                                                                </telerik:RadNumericTextBox>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td style="white-space: nowrap">
                                                                                <asp:Label runat="server" ID="TaxesLabel" Text="Taxes:"></asp:Label>
                                                                            </td>
                                                                            <td>
                                                                                <telerik:RadNumericTextBox runat="server" ID="TaxesRadNumericTextBox" ReadOnly="true"
                                                                                    Width="100px" EnabledStyle-HorizontalAlign="Right" NumberFormat-DecimalDigits="3" CssClass="AlignedRadNumericTextBox">
                                                                                </telerik:RadNumericTextBox>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td colspan="2">
                                                                                <hr />
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td style="white-space: nowrap">
                                                                                <asp:Label runat="server" ID="TotalLabel" Text=" Total:"></asp:Label>
                                                                            </td>
                                                                            <td>
                                                                                <telerik:RadNumericTextBox runat="server" ID="subTotalRadNumericTextBox" ReadOnly="true"
                                                                                    Width="100px" EnabledStyle-HorizontalAlign="Right" NumberFormat-DecimalDigits="2" CssClass="AlignedRadNumericTextBox">
                                                                                </telerik:RadNumericTextBox>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </FooterTemplate>
                                                            </telerik:GridTemplateColumn>
                                                            <telerik:GridBoundColumn DataField="field1" HeaderText="field1" DataFormatString="{0:0.000}">
                                                                <HeaderStyle Wrap="false" Width="80px" />
                                                                <ItemStyle Wrap="true" HorizontalAlign="Right" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="AppliedTaxRate" HeaderText="Tax" DataFormatString="{0:0.000}">
                                                                <HeaderStyle Wrap="false" Width="80px" />
                                                                <ItemStyle Wrap="false" HorizontalAlign="Right" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="DeliveryDate" HeaderText="Delivery Date">
                                                                <HeaderStyle Wrap="false" Width="90px" />
                                                                <ItemStyle Wrap="false" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="dueAmt" HeaderText="Due Qty">
                                                                <HeaderStyle Wrap="false" Width="80px" />
                                                                <ItemStyle Wrap="false" />
                                                            </telerik:GridBoundColumn>
                                                          
                                                        </Columns>
                                                        <DetailTables>
                                                            <telerik:GridTableView runat="server" Name="OtherCharges" CommandItemDisplay="Top"
                                                                DataKeyNames="ItemID, ChargeID" ShowHeader="true" TableLayout="Fixed">
                                                                <CommandItemTemplate>
                                                                    <table width="100%">
                                                                        <tr>
                                                                            <td align="left">
                                                                                <asp:Image ID="ChargeImage" runat="server" ></asp:Image>&nbsp;&nbsp;
                                                                                <asp:HyperLink ID="AddOtherChargeHyperLink" runat="server" 
                                                                                    Text="Add Charges to Line Item"></asp:HyperLink>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </CommandItemTemplate>
                                                                <Columns>
                                                                    <telerik:GridTemplateColumn UniqueName="EditColumn" HeaderText="Action">
                                                                        <HeaderStyle Wrap="false" Width="60px" />
                                                                        <ItemStyle Wrap="false" />
                                                                        <ItemTemplate>
                                                                            <asp:HyperLink ID="EditHyperLink" runat="server" Text="Edit" ></asp:HyperLink>
                                                                        </ItemTemplate>
                                                                    </telerik:GridTemplateColumn>
                                                                    <HeaderStyle Wrap="false" Width="50px" />
                                                                    <ItemStyle Wrap="false" HorizontalAlign="Right" />
                                                                    </telerik:GridBoundColumn>--%>
                                                                    <telerik:GridBoundColumn DataField="UnitPrice" HeaderText="Unit Price" DataFormatString="{0:0.000}">
                                                                        <HeaderStyle Wrap="false" Width="80px" />
                                                                        <ItemStyle Wrap="false" HorizontalAlign="Right" />
                                                                    </telerik:GridBoundColumn>
                                                                    <telerik:GridBoundColumn DataField="Average" HeaderText="Average">
                                                                        <ItemStyle Wrap="false" HorizontalAlign="Right" />
                                                                        <HeaderStyle Wrap="false" Width="230px" />
                                                                    </telerik:GridBoundColumn>
                                                                    <telerik:GridBoundColumn DataField="" HeaderText="" EmptyDataText="0.000">
                                                                        <HeaderStyle Wrap="false" Width="80px" />
                                                                        <ItemStyle Wrap="false" HorizontalAlign="Right" />
                                                                    </telerik:GridBoundColumn>
                                                                    <telerik:GridBoundColumn DataField="AppliedTaxRate" HeaderText="Tax" DataFormatString="{0:0.000}">
                                                                        <ItemStyle Wrap="false" HorizontalAlign="Right" />
                                                                        <HeaderStyle Wrap="false" Width="80px" />
                                                                    </telerik:GridBoundColumn>
                                                                    <telerik:GridBoundColumn DataField="ChargeID" Display="false">
                                                                    </telerik:GridBoundColumn>
                                                                    <telerik:GridBoundColumn DataField="Abc" HeaderText="&nbsp" EmptyDataText="&nbsp" Groupable="false" Reable="false" AllowSorting="false">
                                                                        <ItemStyle Wrap="false" />
                                                                        <HeaderStyle Wrap="false" Width="640px" />
                                                                    </telerik:GridBoundColumn>
                                                                </Columns>
                                                            </telerik:GridTableView>
                                                        </DetailTables>
                                                    </MasterTableView>
                                                </telerik:RadGrid>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                               
                            </asp:Panel>
                        </ContentTemplate>
                        <Commands>
                            <telerik:DockExpandCollapseCommand />
                            <telerik:DockCommand Text="Save Position" AutoPostBack="true" />
                        </Commands>
                    </telerik:RadDock>
                </telerik:RadDockZone>
            </telerik:RadDockLayout>
            <telerik:RadWindowManager ID="AddEditRadWindowManager" runat="server">
                <Windows>
                    <telerik:RadWindow ID="ItemAddDialog" Title="LineItem Add" Left="150px"
                        runat="server" />
                    <telerik:RadWindow ID="ItemEditDialog" Title="LineItem Edit" Left="150px"
                        runat="server" />
                    <telerik:RadWindow ID="ChargeAddDialog" Title="OtherCharge Add" Left="150px"
                        runat="server" />
                    <telerik:RadWindow ID="ChargeEditDialog" Title="OtherCharge Edit"
                        Left="150px" runat="server" />
                </Windows>
            </telerik:RadWindowManager>
        </telerik:RadPane>
    </telerik:RadSplitter>
</asp:Content>


And my code behind is 




public partial class Sample
{
  
    protected void Page_Init(object sender, EventArgs e)
    {
        AddCustomPager(sampleRadGrid);
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        radAjaxManagerProxy.AjaxSettings.AddAjaxSetting(radAjaxManagerProxy, sampleRadGrid);
        radAjaxManagerProxy.AjaxSettings.AddAjaxSetting(sampleRadGrid, sampleRadGrid);
        radAjaxManagerProxy.AjaxSettings.AddAjaxSetting(ExpandCollapseAllLinkButton, sampleRadGrid);
       
    }

    protected void sampleRadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        Decimal liSubtotal = 0;
        Decimal liCharges = 0;
        Decimal liTaxes = 0;
        Decimal liTotal = 0;
        DataRow lineItemRow;

        Decimal unitPrice = 0M;
        Decimal Qty = 0M;

        Record = GetOrder(true);
        if (Record != null)
        {
            foreach (ItemInfo item in Record.ItemInfoList)
            {
                unitPrice = Math.Round(item.UnitPrice, 3);
                Qty = Math.Round(item.Qty, 3);

                lineItemRow = ItemDataTable.NewRow();
                lineItemRow["recordId"] = item.recordId;
                lineItemRow["ID"] = item.Id;              
                lineItemRow["RecordName"] = item.RecordName;
                lineItemRow["Comment"] = item.Comment;
                lineItemRow["Qty"] = Qty;
                lineItemRow["UnitPrice"] = unitPrice;
                lineItemRow["Subtotal"] = Math.Round(Qty * unitPrice, 3);
                lineItemRow["Date"] = item.Date.ToShortDateString();
                lineItemRow["Charges"] = Math.Round(item.Charges, 3);

              
            }
            if (Record.PurchaseId.HasValue)
            {
                try
                {
                   
                }

        
                catch (Exception ex)
                {
                   
                }
            }
            else
            {
                AvailableLabel.Visible = false;
                AvailableValueLabel.Visible = false;
            }
            sampleRadGrid.DataSource = _lineItemDataTable;
            sampleRadGrid.DataMember = "items";
            liTotal = Math.Round(liSubtotal + liCharges + liTaxes, 3);
            _totalChargesValue = liCharges;
            _totalSubtotalValue = liSubtotal;
            _totalTaxesValue = liTaxes;
            RecordTotalValue = liTotal;
           TotalValueLabel.Text = liTotal.ToString();
        }
    }

    protected void sampleRadGrid_ItemCreated(object sender, GridItemEventArgs e)
    {
       
        if (_requireReload)
        {
            Record = GetOrder(false);
            GridDataItem dataItem = e.Item as GridDataItem;
          
            if (e.Item.OwnerTableView.DataMember == "items" && e.Item is GridDataItem)
            {
            }
            //details table edit hyperlink 
            else if (e.Item is GridDataItem)
            {
            }

            else if (e.Item is GridCommandItem)
            {
                if (e.Item.OwnerTableView.DataMember == "items")
                {
                }
                else
                {
                    HyperLink otherChargeHyperLink = e.Item.FindControl("OtherChargeHyperLink") as HyperLink;
                    if (otherChargeHyperLink != null)
                    {
                        Int32 DueAmt = Convert.ToInt32(e.Item.OwnerTableView.ParentItem.GetDataKeyValue("DueAmt"));
                        Int32 Qty = Convert.ToInt32(e.Item.OwnerTableView.ParentItem.GetDataKeyValue("Qty"));
                        otherChargeHyperLink.Enabled = (DueAmt == Qty);
                        if (PartPermission.Check(PartPerm.PartOrderItems) && Record.OrderReceiveStatus.Equals(OrderReceiveStatus.Open.ToString()) && otherChargeHyperLink.Enabled)
                        {
                            otherChargeHyperLink.Attributes["href"] = "#";
                           
                        }
                    }
                }
            }
            HyperLink LineItemHyperLink = e.Item.FindControl("LineItemHyperLink") as HyperLink;
            if (LineItemHyperLink != null)
            {
                if (PartPermission.Check(PartPerm.PartOrderItems) && Record.OrderReceiveStatus.Equals(OrderReceiveStatus.Open.ToString()))
                {
                    LineItemHyperLink.Attributes["href"] = "#";
                    
                }
            }
            foreach (GridItem item in sampleRadGrid.MasterTableView.Controls[0].Controls)
            {
                if (!_isFirstTime)
                {
                    if (ViewState["Expanded"] == null)
                        item.Expanded = false;
                    else
                        item.Expanded = true;
                }
               
                if (_isFirstTime)
                    ViewState["Expanded"] = null;
            }
        }
    }

    protected void sampleRadGrid_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)
    {
        if (_requireReload)
        {
            GridDataItem gridDataItem = e.DetailTableView.ParentItem as GridDataItem;
            if (gridDataItem != null)
            {
                Int32 recordId = 0;
                Int32.TryParse(gridDataItem.GetDataKeyValue("recordId").ToString(), out recordId);
                if (recordId != 0)
                {
                    try
                    {
                        DataTable chargesDataTable = new DataTable("chargesDataTable");
                        chargesDataTable.Columns.Add(new DataColumn("ChargeID"));
                        chargesDataTable.Columns.Add(new DataColumn("recordId"));
                        chargesDataTable.Columns.Add(new DataColumn("ChargeType"));
                        chargesDataTable.Columns.Add(new DataColumn("AppliedTaxRate", System.Type.GetType("System.Decimal")));
                        chargesDataTable.Columns.Add(new DataColumn("UnitPrice", System.Type.GetType("System.Decimal")));
                        chargesDataTable.Columns.Add(new DataColumn("average", System.Type.GetType("System.Decimal")));
                        chargesDataTable.Columns.Add(new DataColumn("Charges", System.Type.GetType("System.Decimal")));
                        ChargeInfoList ChargeInfoList = ChargeInfoList.GetInfoList(recordId);
                        DataRow OtherChargesRow;
                        foreach (ChargeInfo otherItem in ChargeInfoList)
                        {
                            ItemInfo ItemInfo = ItemInfo.GetInfo(recordId);
                            OtherChargesRow = chargesDataTable.NewRow();
                            OtherChargesRow["OrderOtherChargeID"] = otherItem.OrderOtherChargeID;
                            OtherChargesRow["recordId"] = otherItem.recordId;
                            OtherChargesRow["ChargeType"] = otherItem.OtherChargeType;
                            OtherChargesRow["UnitPrice"] = Math.Round(otherItem.UnitPrice, 3);
                            OtherChargesRow["AppliedTaxRate"] = Math.Round(otherItem.AppliedTaxRate, 3);
                            OtherChargesRow["average"] = Math.Round(ItemInfo.Qty * otherItem.UnitPrice, 3);
                            OtherChargesRow["Charges"] = 0.00;
                            chargesDataTable.Rows.Add(ChargesRow);
                        }
                        e.DetailTableView.DataSource = chargesDataTable;
                        e.DetailTableView.DataMember = "OtherCharges";
                    }
                    catch (Exception ex)
                    {
                        
                    }
                }
            }
        }
    }

    private void InitializeGrid()
    {
        
        if (_requireReload)
        {
            _lineItemDataTable = new DataTable("LineItemsDataTable");
            _lineItemDataTable.Columns.Add(new DataColumn("recordId"));
            _lineItemDataTable.Columns.Add(new DataColumn("Id"));
            _lineItemDataTable.Columns.Add(new DataColumn("Reference"));
            _lineItemDataTable.Columns.Add(new DataColumn("Number"));
            _lineItemDataTable.Columns.Add(new DataColumn("PartID"));
            _lineItemDataTable.Columns.Add(new DataColumn("RecordName"));
            _lineItemDataTable.Columns.Add(new DataColumn("Comment"));
            _lineItemDataTable.Columns.Add(new DataColumn("Qty", System.Type.GetType("System.Decimal")));
            _lineItemDataTable.Columns.Add(new DataColumn("UnitMeasure"));
            _lineItemDataTable.Columns.Add(new DataColumn("UnitPrice", System.Type.GetType("System.Decimal")));
            _lineItemDataTable.Columns.Add(new DataColumn("Subtotal", System.Type.GetType("System.Decimal")));
            _lineItemDataTable.Columns.Add(new DataColumn("Date"));
            _lineItemDataTable.Columns.Add(new DataColumn("DueAmt", System.Type.GetType("System.Decimal")));
            _lineItemDataTable.Columns.Add(new DataColumn("Charges", System.Type.GetType("System.Decimal")));
            _lineItemDataTable.Columns.Add(new DataColumn("AppliedTaxRate", System.Type.GetType("System.Decimal")));
        }
    }

    protected void sampleRadGrid_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (_requireReload)
        {
            Decimal Qty = 0;
            Decimal DueAmt = 0;

            Record = GetOrder(false);
            if (e.Item is GridDataItem)
            {
                Decimal ItemTotalValue = 0;
                Decimal ChargesTotalValue = 0;
                if (e.Item.OwnerTableView.DataMember.Equals("items"))
                {
                    GridDataItem dataItem = e.Item as GridDataItem;
                    Decimal ChargesValue = Convert.ToDecimal(dataItem["Charges"].Text);
                    Decimal subtotalValue = 0;
                    Label TotalLabel = dataItem["Average"].FindControl("TotalLabel") as Label;
                    if (TotalLabel != null)
                        subtotalValue = Convert.ToDecimal(TotalLabel.Text);
                    Decimal taxesValue = Convert.ToDecimal(dataItem["AppliedTaxRate"].Text);
                    orderLineItemTotalValue = ChargesValue + subtotalValue + taxesValue;
                    HyperLink cancelLineItemLink = e.Item.FindControl("CancelItemHyperLink") as HyperLink;
                    DueAmt = Convert.ToDecimal(dataItem["DueAmt"].Text);
                    Qty = Convert.ToDecimal(dataItem["Qty"].Text);
                   
                   
                    
                }
                if (e.Item.OwnerTableView.DataMember.Equals("OtherCharges"))
                {
                    Decimal totalTaxesOtherCharge = 0;
                    GridDataItem dataItem = e.Item as GridDataItem;
                    Decimal subtotalOtherChargeValue = 0;
                    subtotalOtherChargeValue = Convert.ToDecimal(dataItem["Average"].Text);
                    totalTaxesOtherCharge += Convert.ToDecimal(dataItem["AppliedTaxRate"].Text);
                    orderOtherChargesTotalValue = subtotalOtherChargeValue + totalTaxesOtherCharge;
                    HyperLink editOtherChargeLink = e.Item.FindControl("EditChargeHyperLink") as HyperLink;
                    DueAmt = Convert.ToInt32(e.Item.OwnerTableView.ParentItem.GetDataKeyValue("DueAmt"));
                    Qty = Convert.ToInt32(e.Item.OwnerTableView.ParentItem.GetDataKeyValue("Qty"));

                   
                }
            }
            if (e.Item is GridFooterItem && e.Item.OwnerTableView.DataMember.Equals("items"))
            {
                GridFooterItem footerItem = e.Item as GridFooterItem;
                if (footerItem != null)
                {
                    RadNumericTextBox TotalRadNumericTextBox = footerItem.FindControl("TotalRadNumericTextBox") as RadNumericTextBox;
                    if (TotalRadNumericTextBox != null)
                        TotalRadNumericTextBox.Text = Math.Round(_totalSubtotalValue, 3).ToString();

                    RadNumericTextBox ChargesRadNumericTextBox = footerItem.FindControl("ChargesRadNumericTextBox") as RadNumericTextBox;
                    if (ChargesRadNumericTextBox != null)
                        ChargesRadNumericTextBox.Text = Math.Round(_totalChargesValue, 3).ToString();

                    RadNumericTextBox taxesRadNumericTextBox = footerItem.FindControl("TaxesRadNumericTextBox") as RadNumericTextBox;
                    if (taxesRadNumericTextBox != null)
                        taxesRadNumericTextBox.Text = Math.Round(_totalTaxesValue, 3).ToString();

                    RadNumericTextBox subTotalRadNumericTextBox = footerItem.FindControl("subTotalRadNumericTextBox") as RadNumericTextBox;
                    if (subTotalRadNumericTextBox != null)
                        subTotalRadNumericTextBox.Text = Math.Round((RecordTotalValue), 2).ToString();
                }
            }
        }
    }

    protected void ExpandCollapseAllLinkButton_Click(object sender, EventArgs e)
    {
        foreach (GridItem item in sampleRadGrid.MasterTableView.Controls[0].Controls)
        {
            if (ViewState["Expanded"] == null)
                item.Expanded = true;
            else
                item.Expanded = false;
        }
        if (ViewState["Expanded"] != null)
            ViewState["Expanded"] = null;
        else
            ViewState["Expanded"] = true;
        sampleRadGrid.MasterTableView.ShowFooter = true;
    }

    protected void ExportToExcelImageButton_Click(object sender, EventArgs e)
    {
        ExportDataToFile();
        ExportToExcel(sampleRadGrid, "SampleGridData");
    }

    protected void ExportToWordImageButton_Click(object sender, EventArgs e)
    {
        ExportDataToFile();
        ExportToWord(sampleRadGrid, "SampleGridData");
    }

    protected void ExportToCsvImageButton_Click(object sender, EventArgs e)
    {
        ExportDataToFile();
        ExportToCsv(sampleRadGrid, "SampleGridData");
    }

    private void ExportDataToFile()
    {
        sampleRadGrid.MasterTableView.ExpandCollapseColumn.Display = false;
        sampleRadGrid.MasterTableView.DetailTables[0].ExpandCollapseColumn.Display = false;
        sampleRadGrid.MasterTableView.DetailTables[0].CommandItemDisplay = GridCommandItemDisplay.None;
        sampleRadGrid.ShowFooter = true;
        sampleRadGrid.MasterTableView.DetailTables[0].ShowFooter = true;
      
    }
    
    

    protected void Page_PreRender(object sender, System.EventArgs e)
    {
        GridItem commandItem = sampleRadGrid.MasterTableView.GetItems(GridItemType.CommandItem)[0];
        ImageButton exportToExcelImageButton = commandItem.FindControl("ExportToExcelImageButton") as ImageButton;
        ImageButton exportToWordImageButton = commandItem.FindControl("ExportToWordImageButton") as ImageButton;
        ImageButton exportToCsvImageButton = commandItem.FindControl("ExportToCsvImageButton") as ImageButton;


        if (sampleRadGrid.Items.Count > 0)
        {
            if (_isFirstTime)
                _isFirstTime = false;
        }
        ExpandCollapseAllLinkButton.Enabled = sampleRadGrid.MasterTableView.Items.Count > 0;
        if (ExpandCollapseAllLinkButton != null)
            ExpandCollapseAllLinkButton.Enabled = sampleRadGrid.Items.Count > 0;
        OrderDetailDetailMenu.PrintOrderPrintLinkButtonControl.Enabled = sampleRadGrid.Items.Count > 0;

        Boolean isGridHasData = sampleRadGrid.Items.Count > 0;


        if (exportToExcelImageButton != null)
        {
            exportToExcelImageButton.Enabled = isGridHasData;
            if (exportToExcelImageButton.Enabled)
            {
                exportToExcelImageButton.Attributes.Add("onclick", String.Format("DisableAjax(\"{0}\", \"\"); return false;", exportToExcelImageButton.UniqueID));
                exportToExcelImageButton.Style.Add(StringResources.CssCursorKey, StringResources.CssCursorValue);
            }
        }
        if (exportToWordImageButton != null)
        {
            exportToWordImageButton.Enabled = isGridHasData;
            if (exportToWordImageButton.Enabled)
            {
                exportToWordImageButton.Attributes.Add("onclick", String.Format("DisableAjax(\"{0}\", \"\"); return false;", exportToWordImageButton.UniqueID));
                exportToWordImageButton.Style.Add(StringResources.CssCursorKey, StringResources.CssCursorValue);
            }
        }
        if (exportToCsvImageButton != null)
        {
            exportToCsvImageButton.Enabled = isGridHasData;
            if (exportToCsvImageButton.Enabled)
            {
                exportToCsvImageButton.Attributes.Add("onclick", String.Format("DisableAjax(\"{0}\", \"\"); return false;", exportToCsvImageButton.UniqueID));
                exportToCsvImageButton.Style.Add(StringResources.CssCursorKey, StringResources.CssCursorValue);
            }
        }

    }

    private Info GetOrder(Boolean clearCache)
    {
        if (_requireReload)
        {
            try
            {
                String cacheName = String.Format("Order{0}{1}", RecordID, _guid);
                if (!clearCache && CacheObject[cacheName] != null)
                    return (Info)CacheObject[cacheName];
                else
                {
                    Info Info = Info.GetInfo(RecordID, true); 
                    AddCache(cacheName, Info);
                    HiddenLabel.Text = RecordID.ToString();
                    DetailTitleLabel.Text = String.Format("Order {0}", RecordID);
                    DetailHeaderLabel.Text = String.Format("Created By {0} {1}", Info.OrderedByFirstName, Info.OrderedByLastName);
                    return Info;
                }
            }
           
            catch (Exception ex)
            {
                
            }
        }
        return null;
    }
}
    protected void AddCustomPager(RadGrid radGrid)
        {
            radGrid.PageSize = 10;
            radGrid.AllowPaging = true;
            radGrid.MasterTableView.PagerStyle.AlwaysVisible = true;
            foreach (GridTableView gridTableView in radGrid.MasterTableView.DetailTables)
            {
                gridTableView.PageSize = 10;
                gridTableView.AllowPaging = true;
                gridTableView.PagerStyle.AlwaysVisible = true;
            }
            radGrid.ItemCreated += new GridItemEventHandler(RadGrid_ItemCreated);
            if (radGrid.ID != "InformationRadGrid")
                radGrid.ItemCommand += new GridCommandEventHandler(RadGrid_ItemCommand);
        }

protected void ExportToExcel(RadGrid searchRadGrid, String fileName)
        {
            searchRadGrid.MasterTableView.HierarchyDefaultExpanded = true;
            if (searchRadGrid.MasterTableView.HasDetailTables)
            {
                foreach (GridTableView gridTableView in searchRadGrid.MasterTableView.DetailTables)
                {
                    
                    gridTableView.AllowPaging = false;
                    gridTableView.HierarchyDefaultExpanded = true;
                }
            }
            searchRadGrid.ExcelExportCellFormatting += new OnExcelExportCellFormattingEventHandler(SearchRadGrid_ExcelExportCellFormatting);
            searchRadGrid.ItemCreated += new GridItemEventHandler(RadGrid_ItemCreated);
            searchRadGrid.ExportSettings.ExportOnlyData = true;
            searchRadGrid.ExportSettings.IgnorePaging = true;
            searchRadGrid.ExportSettings.OpenInNewWindow = true;
            searchRadGrid.ExportSettings.FileName = fileName;
            _isExport = true;
            searchRadGrid.MasterTableView.ExportToExcel();
        }

protected void ExportToWord(RadGrid searchRadGrid, String fileName)
        {
           
            searchRadGrid.MasterTableView.HierarchyDefaultExpanded = true;
            if (searchRadGrid.MasterTableView.HasDetailTables)
            {
                foreach (GridTableView gridTableView in searchRadGrid.MasterTableView.DetailTables)
                {
    gridTableView.AllowPaging = false;
                    gridTableView.HierarchyDefaultExpanded = true;
                }
            }
            searchRadGrid.ItemCreated += new GridItemEventHandler(RadGrid_ItemCreated);
            searchRadGrid.ExportSettings.ExportOnlyData = true;
            searchRadGrid.ExportSettings.IgnorePaging = true;
            searchRadGrid.ExportSettings.OpenInNewWindow = true;
            searchRadGrid.ExportSettings.FileName = fileName;
            _isExport = true;
            searchRadGrid.MasterTableView.ExportToWord();
        }

protected void ExportToCsv(RadGrid searchRadGrid, String fileName)
        {
           
            if (searchRadGrid.MasterTableView.HasDetailTables)
            {
                foreach (GridTableView gridTableView in searchRadGrid.MasterTableView.DetailTables)
                    gridTableView.HierarchyDefaultExpanded = true;
            }
            searchRadGrid.MasterTableView.HierarchyDefaultExpanded = true;
            searchRadGrid.GridExporting += new OnGridExportingEventHandler(RadGrid_GridExporting); // Defect - 9405 - 21 Jun 2011 - By Partner CB  
            searchRadGrid.ItemCreated += new GridItemEventHandler(RadGrid_ItemCreated);
            searchRadGrid.ExportSettings.ExportOnlyData = isExportOnlydata;
            searchRadGrid.ExportSettings.IgnorePaging = true;
            searchRadGrid.ExportSettings.OpenInNewWindow = true;
            searchRadGrid.ExportSettings.FileName = fileName;
            _isExport = true;
            searchRadGrid.MasterTableView.ExportToCSV();
        }

Thanks





Princy
Top achievements
Rank 2
 answered on 14 Feb 2014
5 answers
213 views
Hello, I have a page with multiple tables, and view of one of the table change after I add rows to it's child table. Does anybody know what issue can cause it. I don't have a errors, not in the compiler not in the browser. It stops highlighting the parent row, maybe instead it's trying to do some thing else ....
Olga
Top achievements
Rank 1
 answered on 13 Feb 2014
4 answers
108 views
Hello Telerik,

I have asked Vasil on his blog how to accomplish the following and he suggested that I post here in order to get a more detailed response.

My question is how do I combine the new dropdown checkbox-filter (see the

'Filtering with Client-Side Binding', Country Column example) :


http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/basic-filtering/defaultcs.aspx

with the context menu found here (see the 'Ship City' column):

http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/context-menu/defaultcs.aspx

My desire is to combine them into one dropdown, with the checkbox filters on the bottom half. Also wish to remove the 'Group By' from the menu.

Can you please give me sample code on how to combine the two and remove the one ??

Thanks !
Robert
Top achievements
Rank 1
 answered on 13 Feb 2014
10 answers
576 views
I'm having two issues with my radgrid

1) I have a aggregate group column that instead of showing the sum of the column is showing the last value in column.
2) Since the grouping wasn't working I turned on the groupfooters to show the aggregate sum, but the FooterText is not showing in the footer.

As far as I can tell, I've followed the demos exactly to use both those features.

I've attached a screen shot of the output, notice in the group header that the sum of the cost is wrong and in the footer while the cost sum is correct, the text "Total: " isn't showing.

-Jon

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="GuestAdmin.ascx.cs" Inherits="GuestAdmin" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<telerik:RadGrid ID="GridReunionGuests" AllowFilteringByColumn="False" AllowPaging="True" 
    Skin="Vista" AllowSorting="False" runat="server" AutoGenerateColumns="False" 
    DataSourceID="ReunionGuestsDataSource" GroupingEnabled="true"
    <MasterTableView DataKeyNames="ReunionGuestsID" DataSourceID="ReunionGuestsDataSource" ShowGroupFooter="true"
        <Columns> 
            <telerik:GridBoundColumn DataField="FirstName" HeaderText="First" /> 
            <telerik:GridBoundColumn DataField="LastName" HeaderText="Last" /> 
            <telerik:GridBoundColumn DataField="Age" HeaderText="Age" /> 
            <telerik:GridDropDownColumn DataField="GuestOptionsID" DataSourceID="GuestOptionsDataSource" 
                HeaderText="Options" ListTextField="GuestOption" ListValueField="GuestOptionsID" 
                UniqueName="GuestOption"
            </telerik:GridDropDownColumn> 
            <telerik:GridDropDownColumn DataField="RelationShipsID" DataSourceID="RelationShipsDataSource" 
                HeaderText="Relationship" ListTextField="Description" ListValueField="RelationShipsID" 
                UniqueName="RelationShip"
            </telerik:GridDropDownColumn> 
            <telerik:GridBoundColumn DataField="SpecialRequirements" HeaderText="Special Requirements" /> 
            <telerik:GridBoundColumn DataField="ReunionYear" HeaderText="Reunion" /> 
            <telerik:GridBoundColumn DataField="DateStamp" HeaderText="Date Stamp" /> 
            <telerik:GridDropDownColumn DataField="RegStatusID" DataSourceID="RegStatusDataSource" 
                HeaderText="Status" ListTextField="RegistrationStatus" ListValueField="RegStatusID" 
                UniqueName="Status"
            </telerik:GridDropDownColumn> 
            <telerik:GridBoundColumn DataField="Cost" HeaderText="Cost" FooterText="Total: " Aggregate="Sum" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="Right" DataType="System.Double" /> 
        </Columns> 
        <GroupByExpressions> 
                        <telerik:GridGroupByExpression> 
                            <SelectFields> 
                                <telerik:GridGroupByField HeaderText="Transaction ID" FieldName="transactiongroup"></telerik:GridGroupByField> 
                                <telerik:GridGroupByField FieldName="Email"></telerik:GridGroupByField> 
                                <telerik:GridGroupByField HeaderText="Customer ID" FieldName="CUSTID"></telerik:GridGroupByField> 
                                <telerik:GridGroupByField HeaderText="Cost" FieldName="Cost" Aggregate="Sum"></telerik:GridGroupByField> 
                             </SelectFields> 
                            <GroupByFields> 
                                <telerik:GridGroupByField FieldName="transactiongroup"></telerik:GridGroupByField> 
                            </GroupByFields> 
                        </telerik:GridGroupByExpression> 
                    </GroupByExpressions> 
    </MasterTableView> 
</telerik:RadGrid> 
<asp:SqlDataSource ID="ReunionGuestsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:edu_yale_som_alumnireunion_connectionstring %>" 
    ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [ReunionGuests] WHERE Submitted='true'"
</asp:SqlDataSource> 
<asp:SqlDataSource ID="GuestOptionsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:edu_yale_som_alumnireunion_connectionstring %>" 
    ProviderName="System.Data.SqlClient" SelectCommand="SELECT [GuestOptionsID], [GuestOption] FROM [GuestOptions] WHERE Visible='true' order by DisplayOrder"
</asp:SqlDataSource> 
<asp:SqlDataSource ID="RelationShipsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:edu_yale_som_alumnireunion_connectionstring %>" 
    ProviderName="System.Data.SqlClient" SelectCommand="SELECT [RelationShipsID], [Description] FROM [RelationShips]"
</asp:SqlDataSource> 
<asp:SqlDataSource ID="RegStatusDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:edu_yale_som_alumnireunion_connectionstring %>" 
    ProviderName="System.Data.SqlClient" SelectCommand="SELECT [RegStatusID], [RegistrationStatus] FROM [RegStatus]"
</asp:SqlDataSource> 
 

Diogo
Top achievements
Rank 1
 answered on 13 Feb 2014
3 answers
145 views
Hello,

Our PROD server run .Net framework 4.0

Since we've change our Developement plateform to .Net Framework 4.5,  we have deployement issues when copying the files to the server.  We took care to not use .Net framework 4.5 specific methods / class / option.

On the server,  we sometime have "Pre-compiled"  issue.   I've noticed the following message when make the deployemet:

Warning 2 The following assembly has dependencies on a version of the .NET Framework that is higher than the target and might not load correctly during runtime causing a failure: Telerik.Web.UI, Version=2012.2.607.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4. The dependencies are: System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. You should either ensure that the dependent assembly is correct for the target framework, or ensure that the target framework you are addressing is that of the dependent assembly.

Any idea?

Thank you & best regards,
Michel.
Genady Sergeev
Telerik team
 answered on 13 Feb 2014
2 answers
72 views
Hello Team,
I want to create one series and bound it to multiple items and with different colors for each item
take a look at my picture this what I select from database Day, Date and Total Time sheet.. My problem now like it seems in the picture
that the bars colors didnt change for each item and series in the the right of the chart just read the first date only.. so please can any one help me how can i achieve this programmatically by C#?

Here's my code:
 RadChart1.PlotArea.XAxis.AutoScale = false;
    RadChart1.PlotArea.XAxis.Items.Clear();
    RadChart1.Series.Clear();
    
    ChartSeries series = new ChartSeries(dt.Rows[0]["doc_date"].ToString(), ChartSeriesType.Bar);
    for (int i = 0; i < dt.Rows.Count; i++)
    {
        //series = new ChartSeries(dt.Rows[i]["doc_date"].ToString(), ChartSeriesType.Bar);
        series.Items.Add(new ChartSeriesItem(Convert.ToDouble(dt.Rows[i]["total_timesheet"])));
        ChartAxisItem axisItem = new ChartAxisItem(dt.Rows[i]["day_name"].ToString());
        RadChart1.PlotArea.XAxis.Items.Add(axisItem);
    }
RadChart1.Series.Add(series);
mahmoud
Top achievements
Rank 1
 answered on 13 Feb 2014
8 answers
307 views
Frozen column is not working for grid if navigate the grid controls using tab button of Keyboard. 

Following approach i have used in my application.
Grid columns are mostly GridTemplateColumn type. In that template i am using only ItemTemplate for textboxes controls so that user can navigate grid only using tab to make data entry faster. There are large number of columns(Avg 15 columns) and rows(avg 25 rows) to grid. I need to freeze the  first 3 columns of grid . I have set 
<Scrolling AllowScroll="true" FrozenColumnsCount="3" UseStaticHeaders="True" SaveScrollPosition="True">.
When i am navigating grid using horizontal scrollbar then freeze columns are working but when i am navigating the grid textbox controls using tab, freeze columns are not working. 

Please suggest any working solution to solve this problem.
Sample code for grid columns:

<telerik:GridTemplateColumn HeaderText="Qty/Bundle" HeaderStyle-CssClass="gridHeadStyle-5"
                                                                   ItemStyle-HorizontalAlign="Right">
                                                                   <ItemTemplate>
                                                                       <telerik:RadTextBox ID="QTY" Width="95%" CssClass="textbox-amount" Text='<%#Eval("QnttyPerBundle", "{0:N3}")%>'
                                                                           runat="server" MaxLength="16" onclick="this.select()" AutoPostBack="false" OnTextChanged="txtInvceDetails_TextChanged" />
                                                                   </ItemTemplate>
                                                               </telerik:GridTemplateColumn>
Joe
Top achievements
Rank 1
 answered on 13 Feb 2014
6 answers
381 views
Hi,

I have implemented as below for Rad Editor to open custom popups. Sometimes i am able to see the custom popup opening at first time itself and sometime it is throwing alert as "Custom Command not implemented yet".
1) At initial load of the user control in which i am using RadEditor i am not able to open popup "UploadImage.aspx" on subsequent postback i am able to open and this is also somtime working and some times i am able to see the same alert "Custom Command not implemented yet" I have to make this working in IE, Firfox and Chrome.

Thanks in advance.

EditorPage.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="EditorPage.aspx.vb" Inherits="EditorPage" %>
<%@ Register  tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" language="javascript">
        //<![CDATA[
        /* Implementation of the Custom command, declared in the editor's Tools.xml file! */

        RadEditorCommandList["Custom"] = function (commandName, editor, args) {
            var myCallbackFunction = function (sender, args) {
                if (args.href != undefined) { editor.pasteHtml(String.format("<img src={0} /> ", args.href)) }
            }

            editor.showExternalDialog('../../Controls/Custom/UploadImage.aspx',
          {},
          500,
          230,
          myCallbackFunction,
          null,
          'Insert Image',
          true,
          Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
          false,
          false);
        };

        /*TO DO: Implement something meaningful here*/

        //]]>
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
          <asp:ScriptManager runat="server" ID="ScriptMngr">
    </asp:ScriptManager>
       <telerik:RadEditor runat="server" ID="reWysiwyg" ToolsFile="~/FullSetOfTools.xml"
                        SkinID="DefaultSetOfTools" AutoResizeHeight="true" CssClass="minwidth" ContentAreaMode="div">
                        <ImageManager ViewPaths="~/images" DeletePaths="~/images" UploadPaths="~/images" />
                    </telerik:RadEditor>
    </div>
    </form>
</body>
</html>


FullSetOfTools.xml

<root>
    <modules>
        <module name="RadEditorStatistics" dockingZone="Bottom" enabled="true" visible="true" dockable="true" />
        <module name="RadEditorDomInspector" dockingZone="Module" enabled="true" visible="true" dockable="true" />
        <module name="RadEditorNodeInspector" dockingZone="Module" enabled="true" visible="true" dockable="true" />
        <module name="RadEditorHtmlInspector" dockingZone="Module" enabled="true" visible="false" dockable="true" />
    </modules>
    <tools name="Custom">
    <tool name="Custom"/>
  </tools>
    <tools name="MainToolbar">    
    
    <tool name="InsertLink" />
    <tool name="InsertTableLight" />    
    <tool separator="true"/>
        <tool name="FormatStripper" />
  </tools>
  <tools name="InsertToolbar" >
    <tool name="AjaxSpellCheck"/>    
    <tool separator="true"/>
    <tool name="InsertTable" />    
  </tools>  
  <tools>
    <tool name="Bold" />
    <tool name="Italic" />
    <tool name="Underline" />
    <tool name="ForeColor" />
    <tool name="BackColor"/>
    <tool name="FormatPainter" />
    <tool separator="true"/>
    <tool name="JustifyLeft" />
    <tool name="JustifyCenter" />
    <tool name="JustifyRight" />
    <tool name="JustifyFull" />    
    <tool separator="true"/>    
    <tool name="InsertOrderedList" />
    <tool name="InsertUnorderedList"/>    
  </tools>
  <tools name="DropdownToolbar" >
    <tool name="FontName"/>
    <tool name="RealFontSize"/>
    <tool name="FormatBlock"/>
  </tools>
    <links>
        <link name="Telerik" href="http://www.telerik.com">
            <link name="Products" href="http://www.telerik.com/products">
                <link name="RadEditor" href="http://www.telerik.com/radeditor" >
                    <link name="Accessible RadEditor" href="http://demos.telerik.com/aspnet-ajax/editor/examples/accessibleeditor/defaultcs.aspx" />
                    <link name="Rad Editor for MOSS" href="http://www.telerik.com/products/aspnet-ajax/sharepoint.aspx" />
                </link>
            </link>
            <link name="Purchase" href="http://www.telerik.com/purchase" />
            <link name="Support" href="http://www.telerik.com/support" />
            <link name="Community" href="http://www.telerik.com/community" />
            <link name="Company" href="http://www.telerik.com/company" />
            <link name="Account" href="https://www.telerik.com/login.aspx" />
        </link>
        <link name="Microsoft">
            <link name="Main Site" href="http://www.microsoft.com" />
            <link name="MSDN Online" href="http://msdn.microsoft.com" />
            <link name="Windows Update" href="http://windowsupdate.microsoft.com" />
        </link>
        <link name="Search Engines">
            <link name="Google" href="http://www.google.com" />
            <link name="Bing" href="http://www.bing.com" />
            <link name="Yahoo" href="http://www.yahoo.com" />
        </link>
    </links>
    <snippets>
        <snippet name="Order Confirmation">
            <![CDATA[
                    <div style="width:300px;border:2px outset #D8D2BD;padding:34px;font-family:Arial, Verdana; font-size:11px;background-color:#F1EFE6;">
                    Dear ____________________,<br />
                    Thank you for inquiring about ____________. Your request will be processed in 48 hours and shipped at the address you have provided.
                    <br /><br />
                        <b>Please, contact us if you have any problems.</b>
                    </div>
                ]]>
        </snippet>
        <snippet name="Email Signature">
            <![CDATA[
                    <div style="margin-top:30px;width:80%;border-top:1px dotted gray;padding-top:4px;font-family:Arial, Verdana; font-size:11px;">
                    <b>John Wigham</b><br />
                    Senior Web Developer<br />
                        <a href="#">john@mysite.com</a>
                        <br />
                            <br />
                                <i>Disclaimer: The contents of this e-mail are privileged and confidential and intended for the addressees at the specified e-mail addresses only.</i>
                    </div>
                ]]>
        </snippet>
        <snippet name="Problem Report Feedback">
            <![CDATA[
                    <div style="width:300px;border:2px outset #D8D2BD;padding:34px;font-family:Arial, Verdana; font-size:11px;background-color:#F1EFE6;">
                    Hi ____________________,<br />
                    Thank you for reporting this issue. We have verified the problem and it is logged in our system. We will notify you once we have a solution.
                    <br /><br />
                        <b>Please, contact us if you have any problems.</b>
                    </div>
                ]]>
        </snippet>
    </snippets>
    <symbols>
    </symbols>
    <fontNames>
    </fontNames>
    <fontSizes>
    </fontSizes>
    <colors>
    </colors>
    <classes>
    </classes>
    <paragraphs>
    </paragraphs>
    <dialogParameters>
    </dialogParameters>
    <languages>
    </languages>
</root>

Thanks
Srikanth
Ianko
Telerik team
 answered on 13 Feb 2014
2 answers
138 views
Hello,

I'm trying to use a webapi service (based in DNN 7.2) with the RadSearchBox. Things mostly seem to be working, except that the service doesn't get the text of the search. Note that the service does get called, and, if I generate fake results, it works just fine... it just looks like the SearchBoxContext is empty. Here's what the procedure looks like:

    <AllowAnonymous()>
    <HttpPost()>
    Public Function AutoSearch(context As SearchBoxContext)
(stuff)
End Function

Any ideas?

Thanks,

Mike
Bozhidar
Telerik team
 answered on 13 Feb 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?