Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
323 views
Hi experts

I am exporting a plain excel spreadsheet with a header row, and I am already
using the 'Caption' property for the Title. But I also need to add
the Company name and address on several lines at the top of the table.

How can I achieve this?

Thanks

Clive.
Daniel
Telerik team
 answered on 27 Aug 2009
3 answers
565 views
Hi

I have an export to excel (plain, not ExcelML)  that looks fine, and the cell contens is aligned correctly
(eg numbers are aligned right), but i have not been able to find a way to set the default font for
the entire excel worksheet. It comes out Times New Roman, although the visible version of the
grid is default skin.

I have looked at various code snippets in the docs but no joy so far.

I guess this is really simple and I'll kick myself when I see it...

Thanks for your help

Clive

Daniel
Telerik team
 answered on 27 Aug 2009
8 answers
272 views
Hey another quandary with the ExportToPDF method.
I've been going though the examples and forums learning how to apply some styling to the PDF as it's being exported. Currently I'm able to apply the styles I want for the most part, however whenever I set the 'ignorePaging' setting to True on the export settings, it also seems to ignore my applied styles and also truncates the last column from even being shown.

Here's my export settings:
<ExportSettings Pdf-PageWidth="350mm" Pdf-PaperSize="C5_Envelope" IgnorePaging="true" ExportOnlyData="true"></ExportSettings> 

and here's how I apply my styles (via a ASP button click event):

protected void btnExport_Click(object sender, EventArgs e) 
        {      
            ApplyPDFStyles(); 
            RadGrid1.MasterTableView.ExportToPdf();    
        } 
 protected void ApplyPDFStyles() 
        { 
            foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns) 
            { 
                if (col.UniqueName == "exCol") 
                { 
                    col.Visible = false; //this is a manual expand/collapse collumn I'm hiding. 
                } 
            } 
            GridItem headerItem = RadGrid1.MasterTableView.GetItems(GridItemType.Header)[0]; 
            headerItem.Style["horizaontal-align"] = "left"; 
            headerItem.Style["background-color"] = "#777"; 
            RadGrid1.MasterTableView.GetColumn("ItemNumber").HeaderStyle.Width = Unit.Pixel(35); 
            RadGrid1.MasterTableView.GetColumn("ItemNumber").HeaderStyle.HorizontalAlign = HorizontalAlign.Left; 
            RadGrid1.MasterTableView.GetColumn("COURSE_ID").HeaderStyle.Width = Unit.Pixel(70); 
            RadGrid1.MasterTableView.GetColumn("COURSE_ID").HeaderStyle.HorizontalAlign = HorizontalAlign.Left; 
            RadGrid1.MasterTableView.GetColumn("COURSE_TITLE").HeaderStyle.Width = Unit.Pixel(130); 
 
// 
// many more column styles removed for simplicity...these all apply when ignorePaging is set to false 
// 
 
            foreach (TableCell cell in headerItem.Cells) 
            { 
                cell.Style["text-align"] = "left"; 
            } 
        } 

Adam
Top achievements
Rank 1
 answered on 27 Aug 2009
1 answer
133 views
I am creating Comboboxes dynamically and adding them to a RadGrid during the ItemDataBound event, which works great.  They are using load on demand, virtual scrolling, and marksfirstmatch.

However, when users tab through the comboxes extremely fast, the previous combos are in a dropdown state and are not collapsing on their own.  When you click anywhere on the page they do collapse.  But the requirement is that they should collapse on their own.  This also happens on declared comboboxes.  My concern is for the dynamic server-side combos.

I can't seem to find javascript that will automatically collapse the combos onBlur or onUnfocus or whatever.  I would like to hook it up to my dynamic comboboxes.  I then thought of turning the collapse animation off, however, it is readonly. 

Any help please.

Tad Rhodes
Top achievements
Rank 1
 answered on 27 Aug 2009
2 answers
570 views
These methods are in the documentation, but when I try to use them, I get an error that they are undefined.  Breaking within my javascript reveals that they in fact do NOT exist.  How does one determine whether or not an item is already in the RadListBox on the client-side?

My code is below.  rlbOtherCSRs is a RadListBox and rcbOtherCSRs is a RadComboBox.  I'm trying to copy the item from the combo box to the list box, but only if the list box doesn't already have it.

                function AddOtherCSRClick() {  
                    var rcbOther = $find("<%= rcbOtherCSRs.ClientID %>");  
                    var rlbOther = $find("<%= rlbOtherCSRs.ClientID %>");  
 
                    if (rcbOther.get_selectedIndex() > 0) {  
                        var selected = rcbOther.get_selectedItem();  
                        var existingitem = rlbOther.findItemByValue(selected.get_value());  
                        if (!existingitem) {  
                            var newitem = new Telerik.Web.UI.RadListBoxItem();  
                            newitem.set_value(selected.get_value());  
                            newitem.set_text(selected.get_text());  
                            rlbOther.trackChanges();  
                            rlbOther.get_items().add(newitem);  
                            newitem.select();  
                            rlbOther.commitChanges();  
                        }  
                    }  
                }  
 
mlandauer
Top achievements
Rank 1
 answered on 27 Aug 2009
1 answer
42 views
I have a hierarchical radgrid that is bound to a collection of objects that also have child objects.
These all display fine as master and detail views.

I am attampting to use the popup editmode for the master view.

My popup appears when I click the edit button but "IT APPEARS FOR EACH ROW" of the the master view not just the row I clicked edit on.

I have added a need datasource method to get the objects so it can rebind..  I think that may be why this is happening.
Maybe the grid is going into edit mode and then rebinding, so it shows edit popups for each row.

How can I say edit just this row, without using an objectdatasource?

Not really sure but could use som help asap.
Jedidiah Racine
Top achievements
Rank 1
 answered on 27 Aug 2009
1 answer
90 views
Hi Telerik Team !

I would like to know some thing about the grouping in the radgrid !
Some Days ago, i have a big grid with 1000+ rows and the load of this page was very long ! So boring... not cool
So i now put a group by one field and groupsdefaultExpanded property of the mastertable at "false".

It seems the page load is faster but it is always more than 10sec ! And the display is only 4 or 5 groupheaderitems, so it is too long

So my question is : is the grouping load data and don't display it ?
 If yes, is there a way for load data only when i expand a group ? If not, why the time is so long and can i load quickly my grid

Thanks in advance !
Schlurk
Top achievements
Rank 2
 answered on 27 Aug 2009
3 answers
151 views
Hello,

I'm trying to dynamically change the style (hide/show) of the elements within RadEditor content area. For some reason it doesn't work in IE7 (works fine in FF). Can you please take a look and let me know what I need to change to make it work? I placed similar controls outside of content area of RadEditor and they seem to work fine (3 and 4 checkboxes).

Below is sample page.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Presentation._Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"> 
    <title></title> 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> 
    <script> 
        var prod = "p1"; 
        function toggle(field, checkbox) { 
            var editor = $find("<%= RadEditor1.ClientID%>"); 
            var fieldContainer = editor.get_document().getElementById(prod + field); 
            fieldContainer.style.display = checkbox.checked ? '' : 'none'; 
        } 
 
        function toggleOut(field, checkbox) { 
            var fieldContainer = document.getElementById(prod + field); 
            fieldContainer.style.display = checkbox.checked ? '' : 'none'; 
        } 
    </script> 
    </telerik:RadCodeBlock> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
    </telerik:RadScriptManager> 
    <div id="Div1" style="overflow: hidden; width: 400px; height: 200px;"> 
        <div id="p1color1" style="position: absolute; background-color: red; top: 158px; left: 9px;"><span class="label">Color: </span>Red</div> 
        <div id="p1descr1" style="position: absolute; background-color: blue; top: 15px; left: 43px;"><span class="label">Description: </span>Straw Hat</div> 
    </div> 
    <div> 
        <telerik:RadEditor ID="RadEditor1" runat="server"> 
            <Content> 
                <div id="product1" style="overflow: hidden; width: 400px; height: 200px;"> 
                    <div id="p1color" style="position: absolute; background-color: red; top: 158px; left: 9px;"><span class="label">Color: </span>Red</div> 
                    <div id="p1descr" style="position: absolute; background-color: blue; top: 15px; left: 43px;"><span class="label">Description: </span>Straw Hat</div> 
                </div> 
            </Content> 
        </telerik:RadEditor> 
    </div> 
    <asp:Panel ID="Panel1" runat="server"> 
        <asp:CheckBox ID="CheckBox1" Checked="true" runat="server" OnClick="toggle('color', this)" Text="Color" /><br /> 
        <asp:CheckBox ID="CheckBox2" Checked="true" runat="server" OnClick="toggle('descr', this)" Text="Description" /><br /> 
        <asp:CheckBox ID="CheckBox3" Checked="true" runat="server" OnClick="toggleOut('color1', this)" Text="Color" /><br /> 
        <asp:CheckBox ID="CheckBox4" Checked="true" runat="server" OnClick="toggleOut('descr1', this)" Text="Description" /><br /> 
    </asp:Panel> 
 
    </form> 
</body> 
</html> 
 


Thank you
virt
Top achievements
Rank 1
 answered on 27 Aug 2009
9 answers
977 views
Hi All,

Hopefully someone can put me out of my misery with this one:

Basically we are trying to format a RadGrid to export to PDF, we have followed the export tips and tricks and everything else is working correctly.  The only thing we do want to be able to do is make sure that the first column is a bit wider,  we have tried a few different ways of adding a width and it seems that all of the ways we try get ignored.

So if anyone has successfully modified the width of a column for PDF export please let me know and if possible post some code showing it working.

Thanks heaps

Sean



Daniel
Telerik team
 answered on 27 Aug 2009
6 answers
149 views
I have a page that is a radwindow, but in the code, I have 2 panels. Panel 1 shows up on page load, and depending on the selection, it hides Panel1 and shows Panel2. and from Panel2, the selection needs to close the window and return the result back to parent page.

It works fine except for the loadingpanel. I need a loader to show when it changes from Panel1 to Panel2 and when Panel2 button is closed. But as soon as I put in a Ajaxmanager and the loadingpanel, it wont close the window on uxSelectMarketType button click.

HTML Code
<script type="text/javascript"> 
 
        function RedirectToAddCustomer() { 
            GetRadWindow().BrowserWindow.RedirectToAddCustomer(); 
        } 
 
        function Close() { 
            GetRadWindow().Close(); 
        } 
      
    </script> 
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="uxContinueOrder"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="uxAllPanel" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="uxSelectMarketType"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="uxAllPanel" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Vista"
/> 
    <div> 
        <asp:ImageButton ID="uxCancelNewOrder" runat="server" ImageUrl="~/images/closepopup.gif" 
            CssClass="FR" ToolTip="Cancel" OnClick="uxClose_Click" /> 
        <asp:Panel ID="uxAllPanel" runat="server"> 
            <asp:Panel ID="uxOrderTypePanel" runat="server"> 
                <h2> 
                    Select Order Type</h2> 
                <br /> 
                <asp:RadioButtonList ID="uxOrderTypes" runat="server" CssClass="Table1" Width="100%"> 
                </asp:RadioButtonList> 
                <br /> 
                <asp:Button ID="uxContinueOrder" runat="server" OnClick="SelectOrderTypes_Click" 
                    Text="Continue" CssClass="FR Button"> 
                </asp:Button> 
            </asp:Panel> 
            <asp:Panel ID="uxMarketTypePanel" runat="server" Visible="false"> 
                <h2> 
                    Select Market Type</h2> 
                <br /> 
                <asp:RadioButtonList ID="uxMarketType" runat="server" CssClass="Table1" Width="100%"> 
                </asp:RadioButtonList> 
                <br /> 
                <asp:Button ID="uxSelectMarketType" runat="server" OnClick="uxSelectMarketType_OnClick" 
                    Text="Submit" CssClass="FR Button"> 
                </asp:Button> 
            </asp:Panel> 
        </asp:Panel> 
    </div> 

uxSelectMarketType_OnClick does... and it does run the code RedirectToAddCustomer() but just doesnt call RadWindow.Close().
                ClientScript.RegisterStartupScript(Page.GetType(), "myKey", "RedirectToAddCustomer();", true); 

thdwlgP
Top achievements
Rank 1
 answered on 27 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?