Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
94 views
Hi,

I am new to telerik controls. It seems really good an I have been evaluating it for use in a project I am working on. The client is really impressed with the look/feel/design. But before I can get him to purchase it I need to be sure I can achieve all the results needed. There is only 1 problem, I am unable to get downloads from a grid working. Below is the code I am using to run the download command. The problem is the choose location dialogue box never appear when I click the download link. I need to mention here that the download link is in a nested grid (grid inside a master grid). Could this be the problem? How do I overcome this?

//Code for inner grid. The event is grid_itemcommand()
void gvReceipt_ItemCommand(object source, GridCommandEventArgs e)
    {
        if (e.CommandName == "Download")
        {
         var ExpHeader_ID = (int)((GridEditableItem)e.Item).GetDataKeyValue("ExpenseHeaderID");
            Int32 ExpID = Convert.ToInt32(ExpHeader_ID);
            ExpHeaderIdReceipt = ExpID;
        
            GridDataItem dataItem = (GridDataItem)e.Item;
            Label lblImgeName = (Label)dataItem.FindControl("lblImage");
            string strRequest = lblImgeName.Text;
            if (!string.IsNullOrEmpty(strRequest))
            {
                string path = Server.MapPath(Manage_FilePaths.HeaderExpImagesRootPath_Original 
+ strRequest);
                System.IO.FileInfo file = new System.IO.FileInfo(path);
                
                if (file.Exists)
                {
                    Response.Clear();
                    Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
                    Response.AddHeader("Content-Length", file.Length.ToString());
                    Response.ContentType = "application/octet-stream";
                    Response.WriteFile(file.FullName);
                    Response.End();
                }
                else
                {
                    Response.Write("This file does not exist.");
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.updGrids, typeof(string), "alert", "<script>alert('Please provide a file to download!');</script>", false);
            }
        }
    }
Radoslav
Telerik team
 answered on 18 Apr 2011
5 answers
215 views
Is there a way to change the value of Yaxis major tick labels once the graph is established?

I am passing -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5  for the Y axis.  Client wants all values to show as positive, but respecting the negative position  5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5 on the same Y axis.

Is there a way to step through axis labels and if the value is less than 1, multiply by -1, or just abs() all the ticks?






Evgenia
Telerik team
 answered on 18 Apr 2011
3 answers
62 views
In a hierarchical grid, how can I get the over effect in only master table but NOT in detail table?
The EnableRowHoverStyle gives me the effect both in master and detail table.
Iana Tsolova
Telerik team
 answered on 18 Apr 2011
2 answers
129 views
Hi,
Below code (_doPostBack) is working with explorer but not working with firefox.
Help please.

 <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script language="javascript" type="text/javascript">
            function refreshParent() {
                 __doPostBack('<%=btnSave.UniqueID %>''');
            }
        </script>
 </telerik:RadScriptBlock>

Görkem
Top achievements
Rank 1
 answered on 18 Apr 2011
1 answer
45 views
Hi,
I'm creating a GroupBy expression dynamically based on user input:

RadGrid1.MasterTableView.GroupByExpressions.Add(txtUserInput.Text);

Occasionally the user gets this wrong which causes an error.
I simply want to catch this error in a try/catch block and handle it, but I'm not sure where to put the try/catch.
Any help would be appreciated.
Thanks,
Nick
Veli
Telerik team
 answered on 18 Apr 2011
1 answer
179 views

Hi.
I am migrating a former asp:grid, and since some features must remain the same (or as close to it as possible), the style of the GroupHeader should be similar to the former.
I need to find a way to change de color and size of the text of the GroupHeader:

<SelectFields>
    <telerik:GridGroupByField FieldAlias="My Group Description" FieldName="MyField"></telerik:GridGroupByField>
</SelectFields>

Is there any avaiable property to perform such a customization? And if there's none, can I do it by changing the CSS (even if it means creating a custom grid css file)?

Many thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 18 Apr 2011
1 answer
86 views
is there a way to not highlight the text in a grid when the user selects or drags with their mouse in a grid?  I've attached a screen shot of what it is doing currently.  We have other grids on our site that don't allow this behavior but I cannot figure out how that is possible.

Thanks,

Jon
Sebastian
Telerik team
 answered on 18 Apr 2011
1 answer
138 views
Code is not downloading for sale dashboard demo in asp.net AJAX . Its throwing error like this
:

404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.



please reply fast
Sebastian
Telerik team
 answered on 18 Apr 2011
4 answers
339 views
I'm struggling to get IIS 7 to play nice with Telerik.

I get the following exception when I try to run an .aspx file.  I've migrated the config file using appcmd and adding the WebResouce.axd to both httpHandlers and handlers has not caused the problem to go away.  I'm inclined to think at this point though that the bug is with Telerik since I've seen other posts for third party component bugs cause a general complaint about WebResource.axd not being registgered.

I've gone through the troubleshooting page here on this site for configuration problems:  Please do NOT post this.  I've followed it, but It doesn't address my issue.

Any help would be appreciated. 

I'm using Telerik 2009.2.701.35 on a Windows 2008 R2 box running IIS 7.  The Telerik handlers are all appropriately mapped according to the console manager.

[InvalidOperationException: The WebResource.axd handler must be registered in the configuration to process this request.

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <httpHandlers>
            <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
        </httpHandlers>
    </system.web>
</configuration>]
   System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrlInternal(Assembly assembly, String resourceName, Boolean htmlEncoded) +8552206
   System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrl(Type type, String resourceName, Boolean htmlEncoded) +296
   System.Web.UI.ClientScriptManager.GetWebResourceUrl(Page owner, Type type, String resourceName, Boolean htmlEncoded) +82
   System.Web.UI.ClientScriptManager.GetWebResourceUrl(Type type, String resourceName) +16
   Telerik.Web.SkinRegistrar.RegisterCssReferences(ISkinnableControl _control) +271
   Telerik.Web.UI.RadDataBoundControl.RegisterCssReferences() +51
   Telerik.Web.UI.RadDataBoundControl.ControlPreRender() +36
   Telerik.Web.UI.RadDataBoundControl.OnPreRender(EventArgs e) +22
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
nikhil
Top achievements
Rank 1
 answered on 18 Apr 2011
1 answer
93 views
Hi Telerik Team,

I´m trying to generate a PDF file, without sucess. When I press the button nothing happen.
Please, what´s happening?

This is my code:

<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            function onRequestStart(sender, args) {
                if (args.get_eventTarget().indexOf("exportToFile") >= 0)
                    args.set_enableAjax(false);
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" 
        DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <ClientEvents OnRequestStart="onRequestStart" />
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadComboBox_Estrategia">
            </telerik:AjaxSetting>
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Sunset">
    </telerik:RadSkinManager>
    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" IsSticky="true"
        Style="margin-top: 200px; margin-left: 200px; position: absolute; z-index: 100"
        BackColor="Transparent" MinDisplayTime="1" EnableEmbeddedSkins="False">
        <asp:Image runat="server" ID="LoadingImage1" ImageUrl="~/Images/pmpartner-loader.gif"
            AlternateText="Carregando..." />
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" HorizontalAlign="Center"
        LoadingPanelID="RadAjaxLoadingPanel1">
        <div>
            <table id="tbl_DAS_ESTRATEGIAS" align="center" class="tabela_bege_claro">
                <tr>
                    <td align="right" style="width: 25%">
                        Estratégia:
                        <telerik:RadComboBox ID="RadComboBox_Estrategia" runat="server" DataSourceID="SqlDataSource_Estrategias"
                            Skin="Sunset" AutoPostBack="True" DataTextField="nome" DataValueField="nome"
                            AppendDataBoundItems="True">
                            <Items>
                                <telerik:RadComboBoxItem runat="server" Text="Todas" Value="0"></telerik:RadComboBoxItem>
                            </Items>
                        </telerik:RadComboBox>
                        <asp:SqlDataSource ID="SqlDataSource_Estrategias" runat="server" ConnectionString="<%$ ConnectionStrings:pmpartnerConnectionString %>"
                            SelectCommand="SELECT [codigo], [nome] FROM [pmeasy_020100_ESTRATEGIAS]"></asp:SqlDataSource>
                    </td>
              </tr>
            </table>
        </div>
        <asp:Label ID="totproj" runat="server" Text="Label"></asp:Label>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" DataSourceID="SqlDataSource_grid1"
            Skin="Sunset" Culture="pt-BR" OnItemDataBound="RadGrid1_ItemDataBound" AllowSorting="True"
            CellSpacing="0" GridLines="None" ShowFooter="True" ShowGroupPanel="True" ShowStatusBar="True" Width="100%">
            <ExportSettings FileName="Status_dos_Projetos" IgnorePaging="false" OpenInNewWindow="false">
                <Pdf Author="PMeasy - PMPartner Consultoria" Creator="PMeasy - PMPartner Consultoria"
                    PageHeight="297mm" PageTitle="STATUS DOS PROJETOS - PMeasy - PMPartner Consultoria"
                    PageWidth="210mm" PaperSize="A4" Producer="PMeasy - PMPartner Consultoria" Subject="STATUS DOS PROJETOS"
                    Title="STATUS DOS PROJETOS" />
            </ExportSettings>

                <PagerStyle Mode="NextPrevAndNumeric" />

                <CommandItemTemplate>
                    <asp:ImageButton ID="exportToFile" runat="server" CommandName="ExportToPdf" ImageUrl="images/PDF-icon3.png"
                        AlternateText="STATUS dos Projetos" Style="cursor: pointer;" OnClick="DownloadPDF_Click"/>
                </CommandItemTemplate>

                <CommandItemSettings ExportToPdfText="Exporta para PDF" ShowExportToPdfButton="true"/>

                <Columns>
my columns
                </Columns>

        </telerik:RadGrid>

        <asp:SqlDataSource ID="SqlDataSource_grid1" runat="server" ConnectionString="<%$ ConnectionStrings:pmpartnerConnectionString %>"
            SelectCommand="pmeasy_GRID_oknok" SelectCommandType="StoredProcedure" OnSelected="SqlDataSource_grid1_Selected">
            <SelectParameters>
                <asp:ControlParameter ControlID="RadComboBox_Estrategia" Name="estrategia" PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </telerik:RadAjaxPanel>
    </form>

Thanks, best

Daniel
Shinu
Top achievements
Rank 2
 answered on 18 Apr 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?