Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
242 views
I have a Gridview that that has some radbuttons. One of them allows the user to fill the pdf document and another Radbutton displays the pdf besides GridView. Once I fill the pdf document and click on view pdf button the pdf opens fine besides the gridview. However, the problem is if I click Close button in the RadWindow. Click on Fill to fill the document and click on view pdf Radbutton again to open the pdf it does not open. I am not sure why. Please advise!

I have tried using

string script = "<script language='javascript'>function f(){ShowPDFDocument('" + title + "', '" + url + "');Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";

         
but that didn't help.

Here is some code from my application.  
<telerik:RadAjaxPanel runat="server" LoadingPanelID="LoadingPanel1">
<telerik:RadPageView runat="server" ID="tpDocuments">
                    <asp:Panel ID="pnlDocuments" CssClass="Clear" runat="server">
<div id="divDocuments">
<asp:GridView>
<asp:TemplateField ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" HeaderStyle-BorderColor="#2F4F4F"
ItemStyle-BorderColor="#2F4F4F" ItemStyle-VerticalAlign="Top">
<ItemTemplate>
<telerik:RadButton ID="rdFill" CssClass="AddMargin" CommandArgument="" CommandName="cnFill"
runat="server" CausesValidation="False" Icon-PrimaryIconUrl="~/images/fill.gif"
Skin="Vista" Text="Fill" ToolTip="Fill document" />
</ItemTemplate>
</asp:TemplateField>
 
<asp:TemplateField HeaderStyle-BorderColor="#2F4F4F" ItemStyle-Width="5%" ItemStyle-BorderColor="#2F4F4F"
 HeaderText="View <br/>Doc" ItemStyle-VerticalAlign="Middle" ItemStyle-HorizontalAlign="Left">
 <ItemTemplate>
<telerik:RadButton ID="imgViewImage" runat="server" Width="16px" Height="16px" OnClick="imgViewImage_Click"
 ToolTip="View Document">
 <Image ImageUrl="~/images/preview.gif" IsBackgroundImage="false" />
 </telerik:RadButton>
 </ItemTemplate>
 </asp:TemplateField>
</div>
<div id="divDisplayPDFDocument" class="divDisplayPDFDocument">
</div>

 

 

 

</telerik:RadAjaxPanel>
  <telerik:RadWindow runat="server" ID="PDFDocument" OffsetElementID="divDisplayPDFDocument" Modal="false" Behaviors="Close" VisibleStatusbar="false" VisibleTitlebar="True"
      ReloadOnShow="true" RestrictionZoneID="divDisplayPDFDocument" InitialBehaviors="Close">
  </telerik:RadWindow>

 

<telerik:RadWindow runat="server" ID="PDFWindow" Modal="true" Behaviors="Close, Resize"
    VisibleStatusbar="false" VisibleTitlebar="True" InitialBehaviors="Close, Resize"
    ShowContentDuringLoad="true" VisibleOnPageLoad="false" ReloadOnShow="true" Overlay="true"
    OnClientBeforeClose="PDFWindowBeforeClose" Width="800px" Height="600px">
</telerik:RadWindow>


Server side code

 

 

string title = System.IO.Path.GetFileNameWithoutExtension(tmpDir);
string url = "ViewFilingPreview.aspx?length=" + doc.Filesize + "&ext=" + System.IO.Path.GetExtension(tmpDir).Replace(".", "") + "&file=" + System.IO.Path.GetFileNameWithoutExtension(tmpDir);
string script = "ShowPDFDocument('" + title + "', '" + url + "');";
ScriptManager.RegisterStartupScript(this, GetType(), "ShowPDF", script, true);

 

Client Side code

 

function ShowPDFDocument(title, url) {
var oWnd = $find("<%= PDFDocument.ClientID %>");
oWnd.set_title(title);
oWnd.setUrl(url);
SetPDFSize(oWnd);
// oWnd.set_restrictionZoneID("divDisplayPDFDocument");
// oWnd.argument = title;
// oWnd.remove_pageLoad(windowLoad);
// oWnd.add_pageLoad(windowLoad);
 oWnd.show();
}

 

 

 

 

 

 

 

 

 

 


 


 

 

 

Jinisha
Top achievements
Rank 1
 answered on 05 Jul 2013
2 answers
397 views
Hi, I have the following html button:
<input type="button" id="SubmitEnviado" runat="server" style="display: none !important" onserverclick="SubmitEnviado_Click" />


I need to hide it.

So i tried adding the following to my project's css:
a.rfdSkinnedButton, #ctl00_ContentPlaceMaster_SubmitEnviado, #ctl00$ContentPlaceMaster$SubmitEnviado, #ctl00_ContentPlaceMaster_SubmitEnviado
{
    display: none !important;
}

Its not working.
How can i hide this button ?

Thanks in advance.
Alexandre
Top achievements
Rank 1
 answered on 05 Jul 2013
5 answers
292 views
Hi,

I noticed in the below thread that frozen columns are not supported in mobile browsers. Can you provide a list of RadGrid functionality that is not supported in mobile browsers?

http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-frozen-columns-problem-on-safari-browser-in-apple-ipad.aspx


Thanks,

Ryan
Fraser
Top achievements
Rank 1
 answered on 05 Jul 2013
5 answers
231 views
I am trying to export a table from radeditor to pdf.  I have copied exactly the code in the demo and the pdf shows blank.

        <asp:button runat="server" ID="btnExport" Text="Generate PDF" OnClick="btnExport_Click"/>

        <telerik:RadEditor ID="RadEditor1" runat="server" ContentFilters="DefaultFilters,PdfExportFilter"  Visible="false" >
 <Content>
same code from demo
          </Content>
        </telerik:RadEditor>

        protected void btnExport_Click(object sender, EventArgs e)
        {           
RadEditor1.ExportToPdf();
        }

How can I get the table to export
Ivaylo
Telerik team
 answered on 05 Jul 2013
2 answers
250 views
I'm attaching a jpg of what I see.  I want the export to word and export to excel buttons to go away and for the row that contains them to go away.  Here's the code from my .aspx file:

<telerik:RadGrid ID="rgFields" runat="server" OnNeedDataSource="rgFields_NeedDataSource"
    AutoGenerateColumns="False" CellSpacing="0" GridLines="None" OnItemDataBound="rgFields_ItemDataBound"
    OnItemCreated="rgFields_ItemCreated" MasterTableView-CommandItemDisplay="None">
    <MasterTableView DataKeyNames="FieldID" AllowFilteringByColumn="false" AllowSorting="false" AllowPaging="false" PageSize="1000"
        CommandItemSettings-ShowExportToExcelButton="false" CommandItemSettings-ShowExportToWordButton="false"
        CommandItemSettings-ShowAddNewRecordButton="false" CommandItemSettings-ShowRefreshButton="false">
        <Columns>
            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="FieldName" HeaderText="Field" UniqueName="FieldName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="FieldType.FieldTypeName" HeaderText="Type" UniqueName="FieldTypeName">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

The only other thing I have going on is I reference a skin in App_Themes that has the following code:

<telerik:RadGrid runat="server" AllowPaging="True" AllowSorting="True"
    AllowFilteringByColumn="true" GridLines="None" AutoGenerateColumns="False" Skin="Default"
    PagerStyle-AlwaysVisible="true" PagerStyle-PageSizeLabelText="Number of entries per page:">
    <MasterTableView CommandItemDisplay="top">
        <CommandItemSettings ShowExportToWordButton="True" ShowExportToExcelButton="True" />
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
    </MasterTableView>
    <HeaderStyle Font-Bold="true" VerticalAlign="top" />
    <ExportSettings ExportOnlyData="True" IgnorePaging="True" OpenInNewWindow="True" />
    <GroupingSettings CaseSensitive="false" />
    <AlternatingItemStyle VerticalAlign="Top" />
    <ItemStyle VerticalAlign="Top" />
</telerik:RadGrid>

I'm guessing that this might be messing me up, but I can't figure out how/why.  I'd like to keep the skin, as it works well for 99% of my grids.

Any ideas would be much appreciated.

Thanks!

Laurie
Laurie
Top achievements
Rank 2
 answered on 05 Jul 2013
1 answer
70 views
I am getting this error below. I am using NO javascript or <%..%> code whatsoever. I have tried placing radcodeblock on the page around the <form></form> tags in case radchart is using javascript.

The Controls collection cannot be modified because the control contains code blocks 

(i.e. <% ... %>).


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DashBoard.aspx.cs" Inherits="YS.View.DashBoard.DashBoard" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Charting" TagPrefix="telerik" %>
<%@ Register Assembly="Telerik.OpenAccess.Web.40" Namespace="Telerik.OpenAccess.Web"
  TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
  <link href="../../Styles/Site.css" rel="stylesheet" type="text/css" />
  <title></title>
</head>
<body>
  <telerik:RadScriptManager ID="RadScriptManager" runat="server">
  </telerik:RadScriptManager>
  <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
  </telerik:RadWindowManager>
  <telerik:RadAjaxPanel runat="server" ID="rapGrid" LoadingPanelID="RadAjaxLoadingPanel1">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
      <form id="form1" runat="server">
      <div>
        <div class="quota">
          <asp:Label ID="lblSales" runat="server">Sales Quota</asp:Label>
          <telerik:RadRadialGauge ID="quotaGauge" runat="server" BorderStyle="None" Height="220px"
            Width="220px">
            <Pointer Value="83">
            </Pointer>
            <Scale Min="0" Max="100" MajorUnit="20" MinorUnit="2">
              <Labels Format="{0}%" Position="Inside" />
              <Ranges>
                <telerik:GaugeRange Color="Red" From="0" To="30" />
                <telerik:GaugeRange Color="Orange" From="30" To="70" />
                <telerik:GaugeRange Color="Green" From="70" To="100" />
              </Ranges>
            </Scale>
          </telerik:RadRadialGauge>
        </div>
        <h1>
          <asp:Label ID="Label1" Text="Message Center" runat="server"></asp:Label><telerik:RadDatePicker
            ID="rdpMessageDate" runat="server" OnSelectedDateChanged="rdpMessageDate_SelectedDateChanged">
          </telerik:RadDatePicker>
          <h1>
          </h1>
          <telerik:RadGrid ID="rgMessages" runat="server" CellSpacing="0" GridLines="None"
            OnNeedDataSource="rgMessages_NeedDataSource" Width="350px">
            <MasterTableView AutoGenerateColumns="False">
              <CommandItemSettings ExportToPdfText="Export to PDF" />
              <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                <HeaderStyle Width="20px" />
              </RowIndicatorColumn>
              <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                <HeaderStyle Width="20px" />
              </ExpandCollapseColumn>
              <Columns>
                <telerik:GridDateTimeColumn DataField="date" DataFormatString="{0:dd/MM/yyyy}" FilterControlAltText="Filter date column"
                  HeaderText="Date" UniqueName="date">
                  <ItemStyle Width="50px" />
                </telerik:GridDateTimeColumn>
                <telerik:GridBoundColumn DataField="message" FilterControlAltText="messages" HeaderText="Message"
                  UniqueName="message">
                </telerik:GridBoundColumn>
              </Columns>
              <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
              </EditFormSettings>
              <PagerStyle PageSizeControlType="RadComboBox" />
            </MasterTableView>
            <PagerStyle PageSizeControlType="RadComboBox" />
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
          </telerik:RadGrid>
          <div>
            <asp:Label ID="lblDate" runat="server">Sales To Date</asp:Label>
            <telerik:RadChart ID="rcSales" runat="server" Width="800px">
            </telerik:RadChart>
            <br />
          </div>
        </h1>
      </div>
      </form>
    </telerik:RadCodeBlock>
  </telerik:RadAjaxPanel>
  <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1">
  </telerik:RadAjaxLoadingPanel>
</body>
</html>

As i said I am NOT using anything like that. I didnt start getting the error until I placed a RadChart on the page.

any thoughts?

Thanks,
Richard
richard
Top achievements
Rank 1
 answered on 05 Jul 2013
2 answers
224 views
How to customize Target dropdown of RadEditor insert link?
I want only following options in Target dropdown. Please see attachment for more details.
Same Window
New Window
Parent Window
Browser Window


Thanks in advance.
Vinayak
Top achievements
Rank 1
 answered on 05 Jul 2013
4 answers
205 views
How to persist row in editable mode in radgrid, on page size change?
Scenario:- In my radgrid i have 10 records with page size of 5 records. I am on second page to edit 3rd record(4th index).
Now I change page size from 5 to 10 and the record in edit mode changes. It takes 3rd record among 10.
Ideally 9th row should remain in edit mode.
How to achive this?

Thanks in advance
Vinayak
Top achievements
Rank 1
 answered on 05 Jul 2013
2 answers
109 views
Hello,

I have a Application like Telerik webmail.
When I send Mail without attachment then it works fine. but when I attach document and then send then it throw error of PRM_server.
Screen shot of error is attached.

So plz reply ASAP.

Thanks.
Ajay
Top achievements
Rank 1
 answered on 05 Jul 2013
3 answers
156 views
I have an oddly behaving comboBox.

Here's my markup

 
<telerik:RadComboBox
                runat="server"
                id="rcbSite"
                width="210px"
                enableloadondemand="true"
                onclientitemsrequesting="rcbSite_OnClientItemsRequesting"
                showmoreresultsbox="True"
                enablevirtualscrolling="True" >   
            <WebServiceSettings Method="GetSitesComboBoxDataByCustomerId" Path="/Services/ClientSideDataService.asmx" />
            </telerik:RadComboBox>



Pretty reasonable, comboBox is tied to a webservice.

The onItemsRequesting function adds some extra data bits to the comboBox context that we need.

  
function rcbSite_OnClientItemsRequesting(sender, eventArgs) {
        //Get the selected customer
        var selectedCustomerId = $('#<%= CustomerDropDownId %> option:selected').attr('value');
 
        var context = eventArgs.get_context();
 
        //Set filter text
        context["FilterString"] = eventArgs.get_text();
        context["CustomerId"] = selectedCustomerId;
    }






In my codebehind I create and select an item if one was previously chosen.
if (siteId.HasValue)
{
     rcbSite.Items.Add(SiteManager.GetComboBoxItemBySiteId(siteId.Value));
     rcbSite.SelectedValue = siteId.Value.ToString();
}







And finally on document.ready I attach a selctedIndexChanged event to the comboBox

Sys.Application.add_load(function(){
             
            //If the combo box has items in it, select the first one
            //Selecting first item client side ensures that address fields are refreshed when binding individual item to combo box on initial page load
            var combo = $find("<%= rcbSite.ClientID %>");
            if (combo.get_items().getItem(0)) {
                combo.trackChanges();
                combo.get_items().getItem(0).select();
                combo.commitChanges();
            }
 
            $find("<%= rcbSite.ClientID %>").add_selectedIndexChanged(
            function (sender, eventArgs) {
                var item = eventArgs.get_item();
                 
                var addressFormFields = new InventoryAddressFields("<%= ddlAddressType.ClientID %>", "<%= txtAttenTo.ClientID %>", "<%= txtAddress1.ClientID %>",
                                                               "<%= txtAddress2.ClientID %>", "<%= txtCity.ClientID %>", "<%= ddlCountry.ClientID %>",
                                                           "<%= ddlState.ClientID %>", "<%= ddlCounty.ClientID %>", "<%= txtPostalCode.ClientID %>",
                                                           "<%= txtPostalCodePlus4.ClientID %>", "<%= txtPhone.ClientID %>", "<%= txtFax.ClientID %>",
                                                           "<%= ddlTimezone.ClientID %>", "<%= chkObserveDST.ClientID %>", "<%= ddlVerificationStatus.ClientID %>");
 
                if (item) {
                    var selectedSiteId = item.get_value();
                 
                    GetAddressBySiteId(addressFormFields, selectedSiteId);
                }
                else
                {
                    clearAddressFields(addressFormFields);
                }
    }
    );
    });



Here's my issue:

 1. Page loads with one item inserted into comboBox & selected
 3. Click into comboBox & hit backspace
 4. Click off the comboBox

Expected:
ComboBox fires a selectedIndexChanged event since we now have no item selected

Actual:
Item is removed without firing event


What's interesting is that if you click into the box and off without removing an item. Then click in and remove it, the event fires correctly.

Any ideas?

Andrew
Top achievements
Rank 1
 answered on 05 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?