Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
189 views
I am creating 2 web server controls for our project using telerik asp.net ajax controls. Controls are derived from ISkinnableControl interface. 

I have created skin by  modifying exisiting skin file css classes to build our skin. I want to use custom prefixes for css (i,e myCalendar).  Reason is that  same telerik control is used in both user controls.If I use telerik style class prefixes there could be clash in style.

.myCalendar_<skinname> .rcTitlebar table
{
    
table-layout: auto;
    
width: 100%;
    
border-collapse: separate;
    
border: 0;
    
border-style: none;
}




//code to set css to control (inside userconctrol.cs)

 
protected override void CreateChildControls()
        {  
       
base.CreateChildControls(); 
        _calendar =
new RadCalendar();
        _calendar.EnableEmbeddedSkins =
false;
_calendar.EnableEmbeddedBaseStylesheet =
false;
        _calendar.CssClass =
"myCalendar myCalendar_" + Skin;
        _calendar.Skin = Skin;
...
}





On Aspx page I have RadSkinManager to apply skin to control instances. 
To Apply skin, Currently I have 2 options. I have to do it for each control instance.
1. Set it in markup at design time
2. Set it via page_preinit event.


How can I achieve following
Use custom preffixes in css stylesheets. When RadSkinManager skin changes, it should automatically apply it to control instances. I don't want user to register control instances in radSkinmanager targetControls collection / assign skin  it to indivisual control instances.  

Note: I am storing css files in  library assembly and using stylesheetmanager to load them in application.

My problem is similar to 
http://www.telerik.com/community/forums/aspnet-ajax/skin-manager/generic-code-to-apply-skin-to-all-user-controls-on-page.aspx

Thanks & Regards
Parag 
Iana Tsolova
Telerik team
 answered on 07 Sep 2011
4 answers
222 views
My Site Map is not displaying the child level in Sitefinity | Pages | Site Map | .  The menu system in the 'live site' is working fine; again, it is just in the admin backend that it is not expanding - and just in the actual Pages | Site Map  - the menu displays correctly in the "Edit this page" view. 
Our servers went down last week, so I believe it is a server related issue.  I believe we are on Sitefinity ver 3.7.  We have a number of different sites running Sitefinity and am very happy with it - but at this time, they all have the same error.  With the Child levels not displaying, there is no way to get at the pages to edit them.  [attached image]
Sean
Top achievements
Rank 1
 answered on 07 Sep 2011
1 answer
175 views
RadDataPager version  : 2010.2.713.35

http://demos.telerik.com/aspnet-ajax/datapager/examples/raddatapagerintegration/defaultcs.aspx

OnPageIndexChanged="RadDataPager1_PageIndexChanged"

I can see this in the example but this event does not exist for me.

Plus when I do a search, I want to set the page index to 0, how can I do this, the seems to be not method or property exept

StartRowIndex

wich is read only.

Thanks

Tsvetina
Telerik team
 answered on 07 Sep 2011
1 answer
176 views
Does anyone know if it's possible to use the RadInputManager to compare two TextBox controls the way a CompareValidator control does? I like having the warning icons in my TextBox controls and when I use the CompareValidator control, I don't get them when two TextBox's text properties are different.
Tsvetina
Telerik team
 answered on 07 Sep 2011
19 answers
324 views
Hi,

I am trying to export a radgird to word. But it is not showing me it in proper way.
Please find attached images of how the grid looks and how it gets exported to word.

How to export it as it is on the page, without the controls like Radio buttons and text boxes?

Andrey
Telerik team
 answered on 07 Sep 2011
1 answer
250 views
Hi,

RadGrid is getting hide after clicking of any command button either of Add New Item, Edit, Delete, Sorting, Paging. I'm using NeedDataSource event handler to bind grid. I've added sample code as below. 



ASPX Page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Inventory_Test" EnableEventValidation="false" %>
 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<html>
<head runat="server">
    <title>Enterprise Business Solutions --> Categories</title>
 
    <script type="text/javascript" src="../include/mainscript.js"></script>
 
</head>
<body id="bodyoverflow" onload="focus()">
 
    <script language="javascript" type="text/javascript">
        tb_loading(getLoadingMsg());
    </script>
 
    <form id="form1" runat="server">
    <asp:ScriptManager AsyncPostBackTimeout="600" ID="ScriptManager" runat="server">
    </asp:ScriptManager>
    <table width="100%" cellpadding="0" border="0" cellspacing="0">
        <tr class="HeaderRow">
            <td>
                <PTLUC:TMSHeader ObjNum="311" BOName="ItemMasterBO" runat="server" ID="HeaderCtrl"
                    ResourceName="">
                </PTLUC:TMSHeader>
            </td>
        </tr>
    </table>
    <div id="div-datagrid">
        <span class="reqField">Fields marked with an asterisk(<span style="color: Red">*</span>)
            are required.</span>
        <br />
        <br />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <telerik:RadDockLayout runat="server" ID="RadDockLayout1">
                    <table width="100%">
                        <tr>
                            <td style="vertical-align: top">
                                <telerik:RadDockZone ID="RadDockZone2" runat="server" Orientation="Vertical" Width="100%"
                                    MinHeight="400px">
                                    <telerik:RadDock ID="RadDock1" runat="server" Title="Grid" Width="100%"
                                        EnableRoundedCorners="true" Resizable="true" DockMode="Default" DockHandle="TitleBar"
                                        EnableDrag="true" ExpandText="Expand" ExpandedHeight="400" CollapseText="Collapse" >
                                        <Commands><telerik:DockExpandCollapseCommand /></Commands>
                                        <ContentTemplate>
                                            <telerik:RadGrid ID="gridFinancialYear" runat="server" AllowAutomaticDeletes="false"
                                                AllowAutomaticInserts="false" ShowFooter="true" PageSize="10" AllowAutomaticUpdates="false"
                                                AllowPaging="True" AutoGenerateColumns="False" OnItemUpdated="gridFinancialYear_ItemUpdated"
                                                OnItemDeleted="gridFinancialYear_ItemDeleted" OnItemDataBound="gridFinancialYear_ItemDataBound"
                                                OnItemInserted="gridFinancialYear_ItemInserted" OnDataBound="gridFinancialYear_DataBound"
                                                AllowSorting="true" OnDeleteCommand="gridFinancialYear_DeleteCommand" OnInsertCommand="gridFinancialYear_InsertCommand"
                                                OnNeedDataSource="gridFinancialYear_NeedDataSource" OnItemCommand="gridFinancialYear_ItemCommand"
                                                OnUpdateCommand="gridFinancialYear_UpdateCommand" Style="font-family: Verdana;
                                                font-size: 8pt;">
                                                <PagerStyle Mode="NextPrevAndNumeric" />
                                                <MasterTableView Width="70%" CommandItemDisplay="TopAndBottom" DataKeyNames="FIN_YEAR_ID"
                                                    HorizontalAlign="NotSet" EditMode="InPlace" AutoGenerateColumns="False">
                                                    <Columns>
                                                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                                                            <ItemStyle CssClass="MyImageButton" />
                                                        </telerik:GridEditCommandColumn>
                                                        <telerik:GridTemplateColumn SortExpression="FROM_DATE" HeaderText="From" HeaderStyle-VerticalAlign="Top">
                                                            <ItemTemplate>
                                                                <PTLUC:TMSLabel Text='<%# Eval("FROM_DATE")%>' runat="server" ID="lblFromDate"></PTLUC:TMSLabel>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:TextBox Text='<%# Eval("FROM_DATE") %>' ID="txtFromDate" runat="server" Style="font-family: Verdana;
                                                                    font-size: 8pt; border-color: #7F9DB9;">
                                                                </asp:TextBox>
                                                            </EditItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn SortExpression="TO_DATE" HeaderText="To" HeaderStyle-VerticalAlign="Top">
                                                            <ItemTemplate>
                                                                <PTLUC:TMSLabel Text='<%# Eval("TO_DATE")%>' runat="server" ID="lblToDate"></PTLUC:TMSLabel>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:TextBox Text='<%# Eval("TO_DATE") %>' ID="txtToDate" runat="server" Style="font-family: Verdana;
                                                                    font-size: 8pt; border-color: #7F9DB9;"></asp:TextBox>
                                                            </EditItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridCheckBoxColumn DataField="IS_LOCKED" UniqueName="IS_LOCKED" SortExpression="IS_LOCKED"
                                                            HeaderText="Lock" HeaderStyle-VerticalAlign="Top">
                                                        </telerik:GridCheckBoxColumn>
                                                    </Columns>
                                                </MasterTableView>
                                            </telerik:RadGrid>
                                        </ContentTemplate>
                                    </telerik:RadDock>
                                </telerik:RadDockZone>
                            </td>
                        </tr>
                    </table>
                </telerik:RadDockLayout>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <PTLUC:PTLTextBox ID="txtId" Style="display: none" runat="server">
    </PTLUC:PTLTextBox>
    <PTLUC:PTLTextBox ID="txtsave" Style="display: none" runat="server"></PTLUC:PTLTextBox>
    <PTLUC:PTLTextBox ID="hidError" Style="display: none" runat="server"></PTLUC:PTLTextBox>
    <PTLUC:PTLTextBox ID="hidAction" Style="display: none" runat="server"></PTLUC:PTLTextBox>
    <PTLUC:PTLTextBox ID="hdnIsRawMaterial" Style="display: none" runat="server"></PTLUC:PTLTextBox>
    <asp:HiddenField runat="server" ID="hdnProfileValue" />
    </form>
 
    <script language="javascript" type="text/javascript">
        tb_remove();
    </script>
 
</body>
</html>


Code Behind:
using System;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using PTLInventoryBO;
using PTLLibs;
using Telerik.Web.UI;
using PTLAdminBO;
using PTLAccountBO;
 
public partial class Inventory_Test : TMSBasePage
{
    int orgId = 1;
 
    protected override void Initialize()
    {
        try
        {
            base.myBO = new ItemMasterBO(base.UserId);
            this.PageID = "Test";
            this.ObjNum = 313;
            this.HeaderCtrl.ObjNum = 313;
            this.myBO.Title = "Products";
            this.TxtID = this.txtId;
            this.TxtSave = this.txtsave;
            this.ObjNum = 301;
            this.myBO.PrimaryKeyValue = Int32.Parse(Request.QueryString["pkid"].ToString());
            FindPageControls();
            base.Initialize();
        }
        catch (Exception ex)
        {
 
        }
    }
 
    private void FindPageControls()
    {
 
    }
 
    protected override void AfterSaveAction()
    {
        hidError.Text = HidErrors.Text;
        base.AfterSaveAction();
    }
 
    protected override void AfterDeleteAction()
    {
        this.hidError.Text = HidErrors.Text.ToString();
        base.AfterDeleteAction();
    }
 
    public override void Save()
    {
        base.Save();
    }
 
    protected override void BindDataToPage()
    {
        try
        {
            base.BindDataToPage();
        }
        catch (Exception ex)
        {
 
        }
    }
 
    public override void BindDataFromPage()
    {
        try
        {
            PageData["ITEM_ID"] = txtId.Text.ToString();
            base.BindDataFromPage();
        }
        catch (Exception ex)
        {
        }
    }
 
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
 
    public void gridFinancialYear_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        try
        {
            gridFinancialYear.DataSource = gridFinancialYear.MasterTableView.DataSource = GetData();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
 
    public DataTable GetData()
    {
        try
        {
            FinancialYearBO objFinYear = new FinancialYearBO(this.UserId);
            if (Session["IsLogMode"] != null && Session["IsLogMode"].ToString() == "true")
                objFinYear.UpdateMode = true;
            else
                objFinYear.UpdateMode = false;
            DataTable dtFinYear = objFinYear.GetFinYear(orgId);
            return dtFinYear;
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
 
    private void DisplayMessage(string text)
    {
        gridFinancialYear.Controls.Add(new LiteralControl(string.Format("<span style='color:red'>{0}</span>", text)));
    }
 
    private void SetMessage(string message)
    {
        gridMessage = message;
    }
 
    private string gridMessage = null;
 
    protected void gridFinancialYear_DataBound(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(gridMessage))
        {
            DisplayMessage(gridMessage);
        }
    }
 
    protected void gridFinancialYear_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
    {
        try
        {
            GridEditableItem item = (GridEditableItem)e.Item;
            String id = item.GetDataKeyValue("FIN_YEAR_ID").ToString();
 
            if (e.Exception != null)
            {
                e.KeepInEditMode = true;
                e.ExceptionHandled = true;
                SetMessage("Financial Year with ID " + id + " cannot be updated. Reason: " + e.Exception.Message);
            }
            else
            {
                SetMessage("Financial Year with ID " + id + " is updated!");
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
 
    protected void gridFinancialYear_ItemInserted(object source, GridInsertedEventArgs e)
    {
        try
        {
            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                SetMessage("Unable to insert. Reason: " + e.Exception.Message);
            }
            else
            {
                //SetMessage("New product is inserted!");
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
 
    protected void gridFinancialYear_ItemDeleted(object source, GridDeletedEventArgs e)
    {
        try
        {
            GridDataItem dataItem = (GridDataItem)e.Item;
            String id = dataItem.GetDataKeyValue("FIN_YEAR_ID").ToString();
 
            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                SetMessage("Financial Year with ID " + id + " cannot be deleted. Reason: " + e.Exception.Message);
            }
            else
            {
                SetMessage("Financial Year with ID " + id + " is deleted!");
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
 
    protected void gridFinancialYear_ItemCommand(object source, GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.EditCommandName)
        {
            gridFinancialYear.MasterTableView.IsItemInserted = false;
        }
        if (e.CommandName == RadGrid.InitInsertCommandName)
        {
            gridFinancialYear.MasterTableView.ClearEditItems();
        }
    }
 
    protected void gridFinancialYear_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        try
        {
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem item = (GridEditableItem)e.Item;
 
                #region General Declarations for Controls in Edit Mode
                TextBox txtFromDate = item.FindControl("txtFromDate") as TextBox;
                TextBox txtToDate = item.FindControl("txtToDate") as TextBox;
 
                #endregion
                if (txtFromDate.Text != "")
                {
                    txtFromDate.Enabled = true;
                    txtToDate.Enabled = true;
                    if (((CheckBox)item["IS_LOCKED"].Controls[0]).Checked)
                    {
                        ((CheckBox)item["IS_LOCKED"].Controls[0]).Enabled = true;
                        ((ImageButton)item["EditCommandColumn"].Controls[0]).Visible = false;
                    }
                }
                else
                    ((CheckBox)item["IS_LOCKED"].Controls[0]).Enabled = true;
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
 
    protected void gridFinancialYear_DeleteCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
        //Get the GridDataItem of the RadGrid    
        GridDataItem item = (GridDataItem)e.Item;
        //Get the primary key value using the DataKeyValue.    
        string FIN_YEAR_ID = item.OwnerTableView.DataKeyValues[item.ItemIndex]["FIN_YEAR_ID"].ToString();
        try
        {
            StockDetailBO objStockBO = new StockDetailBO(this.UserId);
            objStockBO.DeleteStockDetailById(Int32.Parse(FIN_YEAR_ID));
            e.Item.Edit = false;
        }
        catch (Exception ex)
        {
            gridFinancialYear.Controls.Add(new LiteralControl("Unable to delete. Reason: " + ex.Message));
            e.Canceled = true;
        }
 
    }
 
    protected void gridFinancialYear_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
        Guid gmsg = Guid.NewGuid();
        string errmsg;
        //Get the GridEditableItem of the RadGrid    
        GridEditableItem editedItem = e.Item as GridEditableItem;
        //Get the primary key value using the DataKeyValue.    
        string FIN_YEAR_ID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["FIN_YEAR_ID"].ToString();
        try
        {
            FinancialYearBO objFinYear = new FinancialYearBO(this.UserId);
 
            objFinYear.FinId = Int32.Parse(FIN_YEAR_ID);
            objFinYear.OrgId = orgId;
            objFinYear.FromDate = ((TextBox)editedItem.FindControl("txtFromDate")).Text.ToString();
            objFinYear.ToDate = ((TextBox)editedItem.FindControl("txtToDate")).Text.ToString();
            if (((CheckBox)editedItem["IS_LOCKED"].Controls[0]).Checked)
            {
                DateTime fromDate = Convert.ToDateTime(((TextBox)editedItem.FindControl("txtFromDate")).Text.ToString());
                DateTime toDate = Convert.ToDateTime(((TextBox)editedItem.FindControl("txtToDate")).Text.ToString());
                if ((fromDate.ToString("MM/dd/yyyy").Equals(this.Session["FromDate"])) && (toDate.ToString("MM/dd/yyyy").Equals(this.Session["ToDate"])))
                {
                    errmsg = "alert('You cannot lock the current financial year.');";
                    ScriptManager.RegisterStartupScript(gridFinancialYear, gridFinancialYear.GetType(), gmsg.ToString(), errmsg, true);
                }
 
                else
                {
                    objFinYear.IsLocked = ((CheckBox)editedItem["IS_LOCKED"].Controls[0]).Checked;
                    if (objFinYear.FromDate != "" && objFinYear.ToDate != "")
                    {
                        int i;
                        i = DateTime.Compare(fromDate, toDate);
                        if (i > 0)
                        {
                            errmsg = "alert('From Date should not be less than To Date.');";
                            ScriptManager.RegisterStartupScript(gridFinancialYear, gridFinancialYear.GetType(), gmsg.ToString(), errmsg, true);
                        }
                        else
                        {
                            string message = "";
                            if ((message = objFinYear.CheckYear(1)) == "")
                            {
                                //Updating the Financial year details
                                int id = objFinYear.Save();
                                AccountMasterBO objAcc = new AccountMasterBO(this.UserId);
                                objAcc.UpdateAccountBalances(id, orgId, -1);
                            }
                            else
                            {
                                errmsg = "alert('" + message + "');";
                                ScriptManager.RegisterStartupScript(gridFinancialYear, gridFinancialYear.GetType(), gmsg.ToString(), errmsg, true);
                            }
                            e.Item.Edit = false;
                        }
 
                    }
                    else
                    {
                        errmsg = "alert('Date fields cannot be blank.');";
                        ScriptManager.RegisterStartupScript(gridFinancialYear, gridFinancialYear.GetType(), gmsg.ToString(), errmsg, true);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            gridFinancialYear.Controls.Add(new LiteralControl("Unable to update. Reason: " + ex.Message));
            e.Canceled = true;
        }
 
    }
 
    protected void gridFinancialYear_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
        //Get the GridDataInsertItem of the RadGrid    
        GridDataInsertItem insertedItem = (GridDataInsertItem)e.Item;
        Guid gmsg = Guid.NewGuid();
        string errmsg;
        try
        {
            FinancialYearBO objFinYear = new FinancialYearBO(this.UserId);
            objFinYear.FinId = -1;
            objFinYear.OrgId = orgId;
            objFinYear.FromDate = ((TextBox)insertedItem.FindControl("txtFromDate")).Text.ToString();
            objFinYear.ToDate = ((TextBox)insertedItem.FindControl("txtToDate")).Text.ToString();
            objFinYear.IsLocked = ((CheckBox)insertedItem["IS_LOCKED"].Controls[0]).Checked;
            if (objFinYear.FromDate != "" && objFinYear.ToDate != "")
            {
                DateTime fromDate = Convert.ToDateTime(((TextBox)insertedItem.FindControl("txtFromDate")).Text.ToString());
                DateTime toDate = Convert.ToDateTime(((TextBox)insertedItem.FindControl("txtToDate")).Text.ToString());
                int i;
                i = DateTime.Compare(fromDate, toDate);
                if (i > 0)
                {
                    errmsg = "alert('To Date cannot be earlier than From Date.');";
                    ScriptManager.RegisterStartupScript(gridFinancialYear, gridFinancialYear.GetType(), gmsg.ToString(), errmsg, true);
                }
                else
                {
                    string message = "";
                    if ((message = objFinYear.CheckYear(0)) == "")
                    {
                        int fid = -1;
                        //Saving the Financial year details
                        if ((fid = objFinYear.Save()) == -1)
                        {
                            errmsg = "alert('Duplicate Financial year. Please enter unique year.');";
                            ScriptManager.RegisterStartupScript(gridFinancialYear, gridFinancialYear.GetType(), gmsg.ToString(), errmsg, true);
                        }
                        else
                        {
                            //upadting the opening balances for the new year
                            AccountMasterBO objAcc = new AccountMasterBO(this.UserId);
                            objAcc.InsertAccountBalancesForNewYear(fid, orgId);
                        }
                    }
                    else
                    {
                        errmsg = "alert('" + message + "');";
                        ScriptManager.RegisterStartupScript(gridFinancialYear, gridFinancialYear.GetType(), gmsg.ToString(), errmsg, true);
                    }
                    e.Item.Edit = false;
                }
            }
            else
            {
                errmsg = "alert('Date fields cannot be blank..');";
                ScriptManager.RegisterStartupScript(gridFinancialYear, gridFinancialYear.GetType(), gmsg.ToString(), errmsg, true);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
 
    }
}


I've also found the reason of this issue its because of the query string of the page on which this grid is implemented. When grid item is rendered on form then every link item is taking same query string as of page's query string. This issue is not getting occurred when I run above code without using query string.

Please help me...
Tsvetina
Telerik team
 answered on 07 Sep 2011
3 answers
81 views
Is it normal on a tree loaded on demand that node editing is not working?
is there any workaround?

Thank you
Plamen
Telerik team
 answered on 07 Sep 2011
3 answers
509 views
Hi All,

I am facing a problem related to response.BinaryWrite(), it is not working on telerik:RadPageView.
My code is as below.

ASPX:
<telerik:RadPageView ID="vXML" runat="server" CssClass="edit-area">
                    <div class="padded-container">
                        <asp:LinkButton runat="server" EnableViewState="false" class="padded-element-first" OnClientClick="clientButtonClicking();"
                            Text="Download" CommandName="XML" CausesValidation="true" ID="btnExportXML" OnCommand="btnExport_Click" />
                        <label id="btnImportXML" class="padded-element-last" style="cursor: pointer; color: #0E3D4F;
                            text-decoration: underline; display: inline" onclick='toogleDisplays("btnImportXML","divUpldXML"); return false;'>
                            Upload</label>
                        <div id="divUpldXML" style="visibility: hidden; display: inline">
                            <asp:FileUpload CssClass="padded-element-last" EnableViewState="false" runat="server"
                                ID="upldXML" />
                            <asp:RequiredFieldValidator ValidationGroup="grpInputs" ID="vldUpldXml" ControlToValidate="upldXML"
                                runat="server" ErrorMessage="PlaceholderXML is required. Enter valid PlaceholderXML."
                                Text="*" />
                            <asp:RegularExpressionValidator ValidationGroup="grpInputs" Enabled="false" ID="vldRegExpUpldXml"
                                runat="server" ErrorMessage=".xml extension only" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.xml|.XML)$"
                                ControlToValidate="upldXML" />
                        </div>
                    </div>
                    <tzgcontrols:XmlView Style="width: 97%; overflow: scroll; clip: auto; word-wrap: break-word;"
                        EnableViewState="true" ID="ViewerXML" runat="server" CssClass="XmlFormat placeholder-box" />
                </telerik:RadPageView>


Javascript:

       
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            RadAjax.OnStart(
{
 
    btnExportXML: doNotUseAjax,
    btnExportXSLT: doNotUseAjax,
    btnExportXSD: doNotUseAjax
});
            var cancelAjax = false;
 
            function clientButtonClicking(sender, eventArgs) {
                debugger;
                if (eventArgs.get_item().get_value() == "postback") {
                    cancelAjax = true;
                }
            }
 
            function onRequestStart(ajaxManager, eventArgs)
            {
                alert(cancelAjax);
                alert(eventArgs.EventTarget);
                if ((eventArgs.EventTarget == "btnExportXML") && (cancelAjax)) { alert('TEST'); eventArgs.EnableAjax = false; }
                if ((eventArgs.EventTarget == "btnExportXSD") && (cancelAjax)) { eventArgs.EnableAjax = false; }
 
                //Uncomment the line below in case of a file download.
                cancelAjax = false;
            }
             
        </script>
    </telerik:RadCodeBlock>


CS:

public static void DownloadFile(HttpResponse response, Constants.DownloadFileType type, string fileName, byte[] data)
{
    using (var trace = new TraceManager("Default"))
    {
        try
        {
            response.Clear();
            response.Buffer = true;
            byte[] storage = data;
 
            switch (type)
            {
                case Constants.DownloadFileType.XML:
                    //document is xml
                    response.ContentType = "application/xml";
                    response.AddHeader("Content-Disposition", "attachment;filename=" + fileName + ".xml");
                    break;
 
                case Constants.DownloadFileType.XSLT:
                    //document is xslt
                    response.ContentType = "application/xml";
                    response.AddHeader("Content-Disposition", "attachment;filename=" + fileName + ".xslt");
                    break;
                case Constants.DownloadFileType.XSD:
                    //document is xslt
                    response.ContentType = "application/xml";
                    response.AddHeader("Content-Disposition", "attachment;filename=" + fileName + ".xsd");
                    break;
 
                case Constants.DownloadFileType.DOCX:
                    response.ContentType =
                        "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
                    response.AddHeader("Content-Disposition",
                                       "attachment;filename=" + fileName + ".docx");
                    break;
 
                case Constants.DownloadFileType.EMAIL:
                    //document is email
                    response.ContentType = "text/html";
                    response.AddHeader("Content-Disposition",
                                       "attachment;filename=" + fileName + ".html");
                    break;
 
                default:
                    //throw new Exception("Unknown Placeholder type specified.");
                    break;
            }
            response.Cache.SetCacheability(HttpCacheability.NoCache);
            response.BinaryWrite(storage);
            //response.End();
            HttpContext.Current.ApplicationInstance.CompleteRequest();
        }
        catch (Exception ex)
        {
            trace.HandleException(ex);
        }
    }
}

Please help to resolve this issue.
Dimitar Terziev
Telerik team
 answered on 07 Sep 2011
1 answer
115 views

Hi,

We are facing problems with displaced RadGrid header pop-up menu on changing the zoom level of the IE browser.

If we change the IE browser’s zoom level to E.g. 200%, the RadGrid’s header menu (the pop-up on right click of the header) pop’s up away from its expected position and sometimes also goes off the screen. We expect the pop-up menu to pop-up right below the mouse pointer.

Also the header menu shows the correct text the first time, but goes blank the second time. Snapshots of these scenarios are attached along with.

Do you have a fix for the Grid Header pop-up menu to work as expected even after an IE zoom?

Tsvetoslav
Telerik team
 answered on 07 Sep 2011
1 answer
98 views
Dear Sirs,
we are using Telerik's RadScheduler Ajax Control in our web application.
We need to add two DropDownLists to the Appointment's View (Edit/Insert) and manage the event of index changed (cascading lists).
Is it possibile? How can we do that?
Many thanks in advance.
Best Regards.
Sergio
Peter
Telerik team
 answered on 07 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
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?