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

I am trying to export PDF from my RadGrid and its exporting successfully. But i am facing some design issues in the exported PDF file.

1. All the text are coming with Hyperlinks in the exported PDF.
2. Set the Forecolor and width, which are not getting reflected in the exported PDF.

Below is my c# code 

protected void btnExportToPDF_Click(object sender, ImageClickEventArgs e)
        {
            ApplyStylesToPDFExport(RadGrid1.MasterTableView);
            RadGrid1.ExportSettings.OpenInNewWindow = true;
            RadGrid1.ExportSettings.IgnorePaging = true;
            RadGrid1.ExportSettings.FileName = "Test";
            RadGrid1.MasterTableView.ExportToPdf();
        }
 
private void ApplyStylesToPDFExport(GridTableView view)
        {
            GridItem headerItem = view.GetItems(GridItemType.Header)[0];
            foreach (TableCell cell in headerItem.Cells)
            {
        switch (cell.Text)
                {
                    case "A":
                        cell.Width = Unit.Pixel(5); // Tried like this. Not reflecting
                        break;
                    case "B":
                        cell.Style["width"] = "15px"// Tried like this. Not reflecting
                        break;
        }
                cell.Style["font-family"] = "Verdana";
                cell.Style["font-bold"] = "true";
                cell.Style["text-align"] = "left";
                cell.Style["vertical-align"] = "middle";
                cell.Style["font-size"] = "8px";
                cell.ForeColor = System.Drawing.Color.Black; // Tried like this. Not reflecting
 
            }
            GridItem[] dataItems = view.GetItems(GridItemType.Item);
            foreach (GridItem item in dataItems)
            {
                foreach (TableCell cell in item.Cells)
                {
                    cell.Style["font-family"] = "Verdana";
                    cell.Style["text-align"] = "left";
                    cell.Style["vertical-align"] = "left";
                    cell.Style["font-size"] = "6px";
                    cell.Style["text-decoration"] = "none"// Tried like this. Not reflecting
 
                    cell.Style["ForeColor"] = "#000";
                }
            }
            dataItems = view.GetItems(GridItemType.AlternatingItem);
            foreach (GridItem item in dataItems)
            {
                foreach (TableCell cell in item.Cells)
                {
                    cell.Style["font-family"] = "Verdana";
                    cell.Style["text-align"] = "left";
                    cell.Style["vertical-align"] = "middle";
                    cell.Style["font-size"] = "6px";
                    cell.Style["text-decoration"] = "none";
                    cell.ForeColor = System.Drawing.Color.Black;
                }
            }
        }

Please advise.

Thanks
Ranjith
Kostadin
Telerik team
 answered on 06 Jan 2014
6 answers
80 views
Hello, I hope community and Telerik staff will help me to understand if I want too much from RadAjaxManager, and point me what I'm doing wrong.
Trying to explain to support person my problem for almost 4 days now, and still did not get any clear answer, or confirmation that behavior I'm expecting is bug or "by-design".

Anyway, I'm having RadScriptManager and RadAjaxManager controls created on my master page, and then I have this on my content page:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 
<telerik:RadAjaxManagerProxy runat="server">
 
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="cmdButton1" EventName="Click">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnl1" />
                <telerik:AjaxUpdatedControl ControlID="pnl2"  />
            </UpdatedControls>
        </telerik:AjaxSetting>
 
        <telerik:AjaxSetting AjaxControlID="cmdButton2" EventName="Click">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnl2"  />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
 
<asp:Button ID="cmdButton1" runat="server" Text="Button 1" OnClick="cmdButton1_Click" />
 
<asp:Panel ID="pnl1" runat="server">
 
    <asp:Button ID="cmdButton2" runat="server" Text="Button 1" OnClick="cmdButton2_Click" />
    <asp:Label ID="lblPnl1" runat="server" />
</asp:Panel>
 
<asp:Panel ID="pnl2" runat="server">
    <asp:Label ID="lblPnl2" runat="server" />
</asp:Panel>
 
</asp:Content>

and this is code I have in code-behind

protected void Page_Load(object sender, EventArgs e)
{
  lblPnl1.Text = lblPnl2.Text = DateTime.Now.ToString();       
}
 
protected void cmdButton1_Click(object sender, EventArgs e)
{
  //do nothing Page_Load will update content of labels
}
 
protected void cmdButton2_Click(object sender, EventArgs e)
{
  //do nothing Page_Load will update content of labels
}

As you can see I have 2 buttons, and I defined for them 2 AjaxSettings inside RadAjaxManagerProxy
So, according to these settings I'm expecting the following behavior:

1. When button cmdButton1 is clicked - RadAjaxManager should refresh my pnl1 and pnl2 Panels
2. When button cmdButton2 is clicked - RadAjaxManager should only refresh my pnl2 Panel.

However, when I'm clicking cmdButton2 - BOTH panels beeing refreshed.

If I remove AjaxSetting for button1 and click button2 - things starting work as expected (e.g. pnl1 is not refreshing)

So it seems that AjaxSetting for button1 somehow forces RadAjaxManager to refresh pnl1, even when button1 was not clicked.

Is this expected? Or bug? What you guys think? What behavior you would expect?

I gave up trying to explain why I think this is bug to support person :(

Maybe I don't understand something?

Thanks!
Maria Ilieva
Telerik team
 answered on 06 Jan 2014
3 answers
78 views
Hi,
I m using Rad Scheduler with My Custom Skin , when i try to add New Appointment I getting the following Error , To Overcome this issue which Class i need to change

Microsoft JScript runtime error:

Sys.WebForms.PageRequestManagerServerErrorException: Telerik.Web.UI.RadCalendar

with ID='SharedCalendar' was unable to find embedded skin with name 'Blue'.

Please, make sure that you spelled the skin name correctly, or if you want to use a custom skin,

set EnableEmbeddedSkins=false..

Ivan Zhekov
Telerik team
 answered on 06 Jan 2014
5 answers
96 views
Dear M Telerik,

I'm currently using a RadFileExplorer control two times in the same page. I have the configuration attributes EnableAsyncUpload="true". When I try to upload a file it works great. But when I try again, I'm unable to click the button to open the file browser. In the HTML code, there is no node <input type="file"> any more.

This is my specific code :
<telerik:RadFileExplorer runat="server" ID="ImageExplorer" Width="500" EnableCopy="true">
    <Configuration ViewPaths="~/Portals/0/fichiers/" UploadPaths="~/Portals/0/fichiers/" DeletePaths="~/Portals/0/fichiers/" AllowMultipleSelection="true" MaxUploadFileSize="1024000" EnableAsyncUpload="true"></Configuration>
</telerik:RadFileExplorer>

It has the same behaviour in both radFileExplorer.

Thanks in advance for your help.
Vessy
Telerik team
 answered on 06 Jan 2014
5 answers
239 views
Hello,

in my test scenario i insert a radbutton into the group header. This stuff is done in the following methods:

protected void RadGrid1_OnItemDataBound(object sender, GridItemEventArgs e)
       {
          _AppendButtonToHeader(e.Item);           
       }
 
       protected void RadGrid1_OnItemCreated(object sender, GridItemEventArgs e)
       {
          _AppendButtonToHeader(e.Item);
       }
 
       private void _AppendButtonToHeader(object item)
       {
           if (item is GridGroupHeaderItem)
           {
               var gridGroupHeaderItem = item as GridGroupHeaderItem;
               var dataCell = gridGroupHeaderItem.DataCell;
 
               var radButton = new RadButton();
               radButton.ButtonType = RadButtonType.StandardButton;
               radButton.Text = "do";
               radButton.Click += new EventHandler(radButton_Click);
 
               dataCell.Controls.Add(radButton);
               dataCell.Controls.Add(new LiteralControl(dataCell.Text));
           }
       }

When i load the page for the first time the 'click' on the 'do'-button does not fire a event. Neither in 'radButton_Click' nor in RadGrid1_ItemCommand'. After the second 'click' to the 'do'-button the event fires.
This behavior is very strange or i missed a  configuration.

Here ist the markup for the grid:

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"
                                 AutoGenerateColumns="false" CellSpacing="0" GridLines="None"
                                 ShowGroupPanel="True" OnNeedDataSource="RadGrid1_OnNeedDataSource"
                                 OnItemDataBound="RadGrid1_OnItemDataBound"
                                 OnItemCreated="RadGrid1_OnItemCreated"
                                 OnPreRender="RadGrid1_OnPreRender">
                    <ClientSettings AllowDragToGroup="True">
                    </ClientSettings>
                    <MasterTableView AutoGenerateColumns="False" GroupLoadMode="Server" GroupsDefaultExpanded="False">
                        <GroupByExpressions>
                            <telerik:GridGroupByExpression>
                                <SelectFields>
                                        <telerik:GridGroupByField FieldName="gl1" HeaderText="gl1" />
                                        <telerik:GridGroupByField FieldName="gl2" HeaderText="gl2" />
                                        <telerik:GridGroupByField FieldName="gl3" HeaderText="gl3" />
                                        <telerik:GridGroupByField FieldName="gl4" HeaderText="gl4" />
                                    </SelectFields>
                                <GroupByFields>
                                    <telerik:GridGroupByField FieldName="gl1" SortOrder="Ascending" />
                                    <telerik:GridGroupByField FieldName="gl2" SortOrder="Ascending" />
                                    <telerik:GridGroupByField FieldName="gl3" SortOrder="Ascending" />
                                    <telerik:GridGroupByField FieldName="gl4" SortOrder="Ascending" />
                                </GroupByFields>
                            </telerik:GridGroupByExpression>
                            
                        </GroupByExpressions>
 
                        <Columns>
                        <telerik:GridTemplateColumn HeaderStyle-Width="100px">                               
                                <ItemTemplate>
                                    <telerik:RadButton ID="RadButton1" runat="server" OnClick="OnClick" ButtonType="LinkButton" Text="plah" CommandName=""></telerik:RadButton>
                                    <telerik:RadButton ID="RadButton2" runat="server" OnClick="OnClick" ButtonType="LinkButton" Text="plah" ></telerik:RadButton>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn >
                                <telerik:GridButtonColumn HeaderText="Status" UniqueName="ImageColumn" ButtonType="ImageButton" HeaderStyle-Width="100px" />
                                <telerik:GridBoundColumn DataField="Forecast_Id" DataType="System.String" FilterControlAltText="Filter type1 column" HeaderText="ForecastId"  UniqueName="Forecast" />
                                <telerik:GridBoundColumn Display="False" DataField="Forecast_StdInt03" DataType="System.Int32" UniqueName="Status"  />
                        </Columns>
                     
 
                        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>
 
                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>
 
                        <EditFormSettings>
                            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
 
                    <FilterMenu EnableImageSprites="False"></FilterMenu>
 
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
                </telerik:RadGrid>

Thanks in advance for the help.

Regards Uwe


Mathew
Top achievements
Rank 1
 answered on 06 Jan 2014
1 answer
144 views
I have <input type="file"> inside RadAjaxPanel.
When I post back, I get no files on server side.

I tried the workaround you suggest:
    <radscriptblock id="RadScriptBlock1" runat="server">
 <script type="text/javascript">
     // on upload button click temporarily disables ajax to perform
     // upload actions
     function conditionalPostback(sender, args) {
         if (args.get_eventTarget() == "<%= ButtonSubmit.UniqueID %>") {
             args.set_enableAjax(false);
         }
     }
 </script>
</radscriptblock>
    <telerik:radajaxpanel runat="server" id="RadAjaxPanel1" clientevents-onrequeststart="conditionalPostback">
 <telerik:RadUpload runat="server" id="RadUpload1" />
 <asp:Button id="Button1" runat="server" text="Upload" />
</telerik:radajaxpanel>


but I get "Access is denied" error.

How can I upload a file within this rad ajax panel?
Princy
Top achievements
Rank 2
 answered on 06 Jan 2014
5 answers
127 views
Hi,

I'm using RadMenu both in LTR and RTL directions.  In both menus, I have some menuitems that have text only, some that have text and icon, and some that are icon only.

In none of the themes does the mouseover line up correctly for the icon only menu items.
It is tolerable in some themes, but on other themes like Silk and Glow it looks horrible.

If you use the sample code below and play with having nothing in the text property of the items or an non-breaking space, you see it work differently and looks really messed up.

Note that I picked a random image off an icon site.  If it doesn't work, substitute any 16x16 image.

Bottom line is that I need a way to make sure that the mouseover on icon only menuitems line up properly under the icon.
<div>
    <telerik:RadMenu ID="RadMenuRTL" runat="server" Width="100%" RegisterWithScriptManager="true" Skin="Silk"
        dir="rtl" ClickToOpen="true" Flow="Horizontal">
        <Items>
            <telerik:RadMenuItem Text="" Value="1" ImageUrl="https://cdn1.iconfinder.com/data/icons/fatcow/16/clock_edit.png"
                ToolTip="Tip">
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Text="" Value="2" ImageUrl="https://cdn1.iconfinder.com/data/icons/fatcow/16/clock_edit.png"
                ToolTip="Tip">
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Text="With Text" Value="3" ImageUrl="https://cdn1.iconfinder.com/data/icons/fatcow/16/clock_edit.png"
                ToolTip="Tip">
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Text="" Value="4" ImageUrl="https://cdn1.iconfinder.com/data/icons/fatcow/16/clock_edit.png"
                ToolTip="Tip">
            </telerik:RadMenuItem>
        </Items>
    </telerik:RadMenu>
    <telerik:RadMenu ID="RadMenu1" runat="server" Width="100%" RegisterWithScriptManager="true" Skin="Silk"
        ClickToOpen="true" Flow="Horizontal">
        <Items>
            <telerik:RadMenuItem Text="" Value="1" ImageUrl="https://cdn1.iconfinder.com/data/icons/fatcow/16/clock_edit.png"
                ToolTip="Tip">
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Text="With Text" Value="2" ImageUrl="https://cdn1.iconfinder.com/data/icons/fatcow/16/clock_edit.png"
                ToolTip="Tip">
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Text="" Value="3" ImageUrl="https://cdn1.iconfinder.com/data/icons/fatcow/16/clock_edit.png"
                ToolTip="Tip">
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Text="" Value="4" ImageUrl="https://cdn1.iconfinder.com/data/icons/fatcow/16/clock_edit.png"
                ToolTip="Tip">
            </telerik:RadMenuItem>
        </Items>
    </telerik:RadMenu>
 
</div>
Kate
Telerik team
 answered on 06 Jan 2014
15 answers
320 views
Hi..
     I am Yogesh. I am new to asp.net with c#. I am working with asp.net ajax radgrid control. i want to export grid data to excel, word,pdf.
     Could anyone help me out by posting code for that plz...its urgent.

regards,
yogesh
Kostadin
Telerik team
 answered on 06 Jan 2014
1 answer
138 views
Hi,

I am using the telerik controls (v 2013.3.1015.45) for my project and it is working fine on IE all version. but it is not working on firefox 26.0 . I got following error.
Inline image 1


I have tried the suggested solution on site.
Deyan Enchev
Telerik team
 answered on 06 Jan 2014
9 answers
147 views
Hello .
I am using Telerik 2013 Q1 and I am using menu in my Pages.
I have some problems . First of all if I change The 'Height' of menu ,It doesn't work but I solve it With some Styles.
Secondly The Items were not in Middle of Menu but I solve it too with another Styles.
thirthly when I change the height of menu , the triangles in both side of menu doesn't increase theire Height  and i don't know how I should Solve it.
in fact ,are there any way to solve  my problems without styles and for last question,What should I do?
The Image for last question attached to this Thread and my Styles are at the end of this Message
Thank you.
.rmRootGroup
       {
           height: 40px;  // change the height of Menu
       }
 
li.rmItem
     {
         padding-top:8px !important; // bring Items in Middle of Menu
      }

Kate
Telerik team
 answered on 06 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?