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

I have a RadGrid consisting of a column with hyperlinks.  I would like to ExportToExcel using the following ExcelML option to maintain the formatting:
radGridN.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML; 

However to use the GridExcelExportFormat.ExcelML, I am forced to set ExportOnlyData to true:
radGridN.ExportSettings.ExportOnlyData = true

But then I lose the hyperlink in Excel and see only the Data (as expected).  Is there a way that I can still use ExcelML option to keep the nice formatting and but also get my Hyperlinks to work in Excel?

Greg
Daniel
Telerik team
 answered on 03 Feb 2010
5 answers
167 views
Hi, I am using the Q1 2009 release of your amazing controls. I am using the Panel Bar with a sitemap data source (MOSS2007). This leads to me no being able to expand the panels as the top level items have a url set. I have followed the KB article 'Preserve the expand and collapse functionality of an item which has its NavigateUrl property set.' There are a number of thins that don't add up when comparing the example against the Q1 2009 control.

  1. There is no image element to be found in the DOM of the panelbar the expand arrows are just the backgund image of the SPAN tag. This means that the java script function to trap the click fails everytime as there is no ImageElement
  2. The 'panelbar.AllItems.length' fails on each call as 'AllItems' is undefined.
  3. Using the code behind method to add Image and Expanded Image urls doesn't seem to work for me, the only way I could get them to show up was to modify the css as follows :
/* <expand arrows> */ 
/*
.RadPanelBar_ECPanelBar .rpExpandable .rpText,
.RadPanelBar_ECPanelBar .rpExpanded .rpText
{
    background-color: transparent;
    background-image: url('PanelBar/Expandable.png');
}
*/ 
.RadPanelBar_ECPanelBar .rpExpandable .rpText, 
    background-colortransparent
    background-imageurl('PanelBar/arrow-down.png'); 
 
.RadPanelBar_ECPanelBar .rpExpanded .rpText 
    background-colortransparent
    background-imageurl('PanelBar/arrow-up.png'); 
    background-position: 100% 0px !important; 
 
 
/* </expand arrows> */ 
 
 

The 0px is due to the standard value being -467px and hiding the image.

Please see the markup of the composite control I am making (due to code behind restictions in MOSS this is a much easier way)

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="LeftNav.ascx.cs" Inherits="usercontrols_LeftNav" compilationMode="Always" %> 
<%@ Register assembly="Telerik.Web.UI, Version=2009.1.311.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4"  
        namespace="Telerik.Web.UI" tagprefix="telerik" %> 
         
<script type="text/javascript">      
function onClicking(sender, eventArgs)      
{      
    var target = eventArgs.get_domEvent().target;  
    var item = eventArgs.get_item();  
    if (target == eventArgs.get_item().get_imageElement())  
    {  
        if (item.get_expanded())  
            item.collapse();  
        else  
            item.expand();  
          
        eventArgs.set_cancel(true);  
    }  
}      
</script>  
 
<telerik:RadAjaxManagerProxy runat="server" ID="rampChild" > 
</telerik:RadAjaxManagerProxy> 
<telerik:RadPanelBar runat="server" ID="rpbVertNav" PersistStateInCookie="true"  
     Skin="ECPanelBar"  
    ExpandMode="SingleExpandedItem" EnableEmbeddedSkins="false" 
    OnClientItemClicking="onClicking" onitemdatabound="rpbVertNav_ItemDataBound"
</telerik:RadPanelBar> 
using System; 
using System.Web; 
using Telerik.Web.UI; 
 
public partial class usercontrols_LeftNav : System.Web.UI.UserControl 
 
    private string _siteMapID = "QuickLaunchSiteMap"
 
    public string siteMapID { get { return this._siteMapID; } set { this._siteMapID = value; } } 
 
     
    protected void Page_Load(object sender, EventArgs e) 
    { 
         
    } 
 
    protected override void OnInit(EventArgs e) 
    { 
        base.OnInit(e); 
 
        rpbVertNav.DataSourceID = _siteMapID; 
    } 
 
    protected void rpbVertNav_ItemDataBound(object sender, RadPanelBarEventArgs e) 
    { 
        if (e.Item.Items.Count > 0) 
        { 
            e.Item.ImageUrl = "arrow-down.png"
            e.Item.ExpandedImageUrl = "arrow-up.png"
            e.Item.ImagePosition = RadPanelItemImagePosition.Right; 
        } 
    } 

This is the js I was trying to use as taken from your sample

<script type="text/javascript">   
        <!-- For radPanelBar -->    
        function OnLoad(sender, args)      
        {      
            var panelbar = sender;      
             
            for (var i = 0; i < panelbar.AllItems.length; i++)      
            {      
                var panelItem = panelbar.AllItems[i];      
                      
                if (panelItem.ImageElement)      
                {      
                    panelItem.ImageElement.AssociatedItem = panelItem;      
                    panelItem.ImageElement.onclick = function (e)      
                    {      
                        if (!e) e = window.event;      
                              
                        if (this.AssociatedItem.Expanded)      
                        {      
                            this.AssociatedItem.Collapse();      
                        }      
                        else     
                        {      
                            this.AssociatedItem.Expand();      
                        }      
                              
                        e.cancelBubble = true;      
                        if (e.stopPropagation)      
                        {      
                            e.stopPropagation();      
                        }      
                        return false;      
                    }      
                }      
            }      
        }      
        </script>    

I really want to use this panel bar control for my navigation in this site but i cannot as it will not expand as expected. PLease can you update the sample to work with Q1 2009 or post a 2009 working sample using a sitemapdatasource.

Many Thanks

Chris
Chris
Top achievements
Rank 2
 answered on 03 Feb 2010
2 answers
206 views
I currently have this radgrid and I'm trying to find the control rntbTotalTax2 in the footer using the $find client side command.   How can I find this control using client side scripting.

Here is the javascript that I'm using to test with
:

 

<script type="text/javascript">

 

 

 

function test(sender, args) {

 

 

var parent1 = $find("rg2ConfirmCart");

 

 

var child1 = $find("rntbTotalTax2", parent1);

 

 

 

}

 

 

</script>

 


What happens is that child1 comes back null when test function is fired from a button that is not in the grid.  

<

 

telerik:RadGrid ID="rg2ConfirmCart" runat="server" AllowSorting="true" AutoGenerateColumns="false" OnItemDataBound="rg2CartConfirm_ItemDataBound" ShowFooter="true" >

 

<

 

MasterTableView CommandItemDisplay="None">

 

 

<Columns>

 

 

<telerik:GridTemplateColumn UniqueName="rg2GtcProduct" AllowFiltering="false">

 

 

<HeaderTemplate>

 

 

<asp:Label ID="rg2GtcProductHdr" runat="server" Text="Product"></asp:Label>

 

 

</HeaderTemplate>

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblProductName2" runat="server" Text="" Width="175"></asp:Label><br />

 

 

<asp:Label ID="lblSku2" runat="server" Text="" Width="175"></asp:Label><br />

 

 

</ItemTemplate>

 

 

<FooterTemplate>

 

 

<asp:Button ID="bEditCart" runat="server" Text="Edit Cart" PostBackUrl="~/ts1/index.aspx" /><br />

 

 

<asp:Button ID="bReCalc" runat="server" Text="Recalculate" PostBackUrl="~/ts1/index.aspx" /><br />

 

 

</FooterTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="rg2GtcQty" AllowFiltering="false" HeaderStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right">

 

 

<HeaderTemplate>

 

 

<asp:Label ID="rg2GtcQtyHdr" runat="server" Text="QTY"></asp:Label>

 

 

</HeaderTemplate>

 

 

<ItemTemplate><asp:Label ID="lblQty2" runat="server" Text="" />

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="rg2GtcPrice" AllowFiltering="false" HeaderStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right" FooterStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="Right">

 

 

<HeaderTemplate>

 

 

<asp:Label ID="rg2GtcPriceHdr" runat="server" Text="Price"></asp:Label>

 

 

</HeaderTemplate>

 

 

<ItemTemplate><asp:Label ID="lblPrice2" runat="server" Text="" />

 

 

</ItemTemplate>

 

 

<FooterTemplate>

 

 

<asp:Label ID="lblTotalExtPriceTxt2" runat="server" Text="Subtotal:" />

 

 

</FooterTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="rg2GtcExtPrice" AllowFiltering="false" HeaderStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right" FooterStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="Right">

 

 

<HeaderTemplate>

 

 

<asp:Label ID="rg2GtcExtPriceHdr" runat="server" Text="Ext Price"></asp:Label>

 

 

</HeaderTemplate>

 

 

<ItemTemplate><asp:Label ID="lblExtPrice2" runat="server" Text="" />

 

 

</ItemTemplate>

 

 

<FooterTemplate>

 

 

<asp:Label ID="lblTotalExtPrice2" runat="server" Text="0" CssClass="LabelStyleCartTax" />

 

 

<telerik:RadNumericTextBox ID="rntbTotalTax2" Value="0" Label="Tax:" runat="server" CssClass="LabelStyleCartTax" Type="Percent" Width="35px" SelectionOnFocus="SelectAll" FocusedStyle-HorizontalAlign="Right" EnabledStyle-HorizontalAlign="Right" >

 

 

</telerik:RadNumericTextBox>

 

 

<telerik:RadNumericTextBox ID="rntbTotalShipping2" Value="0" Label="Shipping:" CssClass="LabelStyleCartTax" runat="server" Type="Currency" Width="65px" SelectionOnFocus="SelectAll" FocusedStyle-HorizontalAlign="Right" EnabledStyle-HorizontalAlign="Right" >

 

 

</telerik:RadNumericTextBox>

 

 

<telerik:RadNumericTextBox ID="rntbOrderTotal2" Value="0" ReadOnly="true" Label="Order Total:" CssClass="LabelStyleCartTax" runat="server" Type="Currency" Width="65px" SelectionOnFocus="SelectAll" FocusedStyle-HorizontalAlign="Right" EnabledStyle-HorizontalAlign="Right" >

 

 

</telerik:RadNumericTextBox>

 

 

</FooterTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

<ExpandCollapseColumn Resizable="False" Visible="False">

 

 

<HeaderStyle Width="20px" />

 

 

</ExpandCollapseColumn>

 

 

<RowIndicatorColumn Visible="False">

 

 

<HeaderStyle Width="20px" />

 

 

</RowIndicatorColumn>

 

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 

Webguy
Top achievements
Rank 1
 answered on 03 Feb 2010
2 answers
258 views
I have to enable/disable button on the textchanged event. If I use server side textchanged event with autopostback true, the Ajax request takes some time and in the meantime, the user can click the button which is enabled but has to be disabled on text changed event. How can I do the Javascript Onblur event with RadAjaxmanager on the page or trap the textbox onblur event even if the button is clicked ?

Thanks

Thanks.
Martin
Telerik team
 answered on 03 Feb 2010
5 answers
171 views

Today I upgraded from the Telerik.Web.UI version 2008.3.1125.20 to version 2009.1.311.20. Doing so broke all the javascript/AJAX functionality on my webpage. After a couple of hours of removing controls I eventually narrowed the problem down to setting the RadDock.Visible property to false.

When that property is set to false, either in the markup or in the code behind, a javascript error occurs in the MicrosoftAjax.js file. With identical code this error does not occur for the previous version of the Telerik.Web.UI assembly.

Here is a link to a sample project I have created demonstrating the issue: http://dl.getdropbox.com/u/109257/RadControlsExample.zip.

Currently the project references the 2009.1.311.20 version of the Telerik.Web.UI assembly in the /dep/Telerik.Web.UI/2009.1.311.20 folder. You can run the project to see that an error occurs in the javascript execution of the page. You will also notice that the javascript function DockInitialize() that I added to the Default.aspx markup that changes the cursor when you mouse onto and off of the title bar for the RadDocks does not work because of this error.

If you change the referenced Telerik.Web.UI assembly to the one located in the /dep/Telerik.Web.UI/2008.3.1125.20 folder (the previous version) and uncomment the proper .axd references in the Web.config file you will see that the page loads without error and the javascript functions properly.

I'm would like a solution to this error so I can upgrade as soon as possible. In the meantime I am going to have to use an older version of the Telerik.Web.UI assembly.

Thank you.

Pero
Telerik team
 answered on 03 Feb 2010
1 answer
71 views
Hi,
We are using RadEditorPlaceHolder in MCMS 2002 driven ASP.NET 2.0 application. In edit mode user posts content in to this control. The posting contains text and images. So the height of the control cannot be determined thorough code at design as well as runtime. The AutoResizeHeight property also does not work with this control. So the content is over flown out of control or the control become too lengthy than the content if fix the height through the code / property.

Kindly help me to fix this issue as soon as possible.

Thank you,
Jey
Rumen
Telerik team
 answered on 03 Feb 2010
1 answer
54 views
Hi all

In rad grid the data with in the tags is not displaying I have given ValidateRequest=false as u guys suggested in one of the forums but it is not displaying any suggestions 

And in firefox the filtering icons are getting overlapped with other columns i have tried setting Header style width for each column separatly but it is effecting another browsers i havw also trid setting TableLayout=fixed but no use any suggestions how to get overrid of that.
Radoslav
Telerik team
 answered on 03 Feb 2010
1 answer
85 views
I'm using Q3 2009 SP2

Does SortedBackColor (in SortingSettings) work with client-side data binding using GetBindingData() ?  I'm using GetBindingData() in a web service, and all works great including sorting the data, but I can't get SortedBackColor to work.  If this property is not available with client-side databinding, is there another way to do it?

Thanks.
Radoslav
Telerik team
 answered on 03 Feb 2010
8 answers
275 views
Hi everyone,

I have a grid composed of 3 columns. Each row is in edit mode by default, edit mode is inplace.
1-column input is a template column
2-column value is a boundcolumn
3-column result is a calculated column no expression defined nor datafields

only column input is editable. I create a template with a numerictextbox.
What I would like to do is to update the calculated column when the user ente a value in the column input with the calculation:

        value/input*100

I am not sure I need a calculated column or if a read only regular textbox would be enough.

thank you
regis
Top achievements
Rank 1
 answered on 03 Feb 2010
2 answers
160 views
How to define backcolor for items and alternating items in a self hierarchical grid ?

Actually I'm doing this in page_load and it's not working fine (please see image in attachment)

if (RadGrid1.MasterTableView.DetailTables != null)
        {
            RadGrid1.MasterTableView.DetailTables[0].AlternatingItemStyle.BackColor = System.Drawing.Color.Azure  ;
            RadGrid1.MasterTableView.DetailTables[0].ItemStyle.BackColor = System.Drawing.Color.BlanchedAlmond;

            if (RadGrid1.MasterTableView.DetailTables[0].DetailTables[0] != null)
            {
                RadGrid1.MasterTableView.DetailTables[0].DetailTables[0].AlternatingItemStyle.BackColor = System.Drawing.Color.Azure;
                RadGrid1.MasterTableView.DetailTables[0].DetailTables[0].ItemStyle.BackColor = System.Drawing.Color.BlanchedAlmond;
            }
        }

as I have a sqldatasource with automatic generated columns, I can't define styles in aspx ... 

I also can't define a different image for expanded image. As I have this in code :
         button.CssClass = (item.Expanded) ? "rgCollapse" : "rgExpand";
... I tried to put this in aspx but it doesn't work :
       .rgExpand  
        {  
          background:url('Images/CollapsedButton.gif') center no-repeat;       
        }  
      
       .rgCollapse  
        {  
          background:url('Images/ExpandedButton.gif') center no-repeat;  
        }  

I tried everything but the collapse/expand button doesn't change :

        <telerik:RadGrid ID="RadGrid1" OnPreRender="RadGrid1_PreRender" runat="server" DataSourceID="SqlDataSource1"  OnColumnCreated="RadGrid1_ColumnCreated"
            OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound" Width="100%">
            <MasterTableView  HierarchyDefaultExpanded="false" EnableNoRecordsTemplate="false" HierarchyLoadMode="ServerBind" AllowSorting="true" Width="800px"
                DataKeyNames="EmployeeID" ExpandCollapseColumn-ButtonType="ImageButton" 
ExpandCollapseColumn-Display="true"
ExpandCollapseColumn-ExpandImageUrl="Images/CollapsedButton.gif" 
ExpandCollapseColumn-CollapseImageUrl="Images/ExpandedButton.gif">
                <ItemStyle Wrap="false" Width="200px" BackColor="Azure" Height="17px" BorderWidth="1"/>
                <AlternatingItemStyle Wrap="false" BackColor="BlanchedAlmond" Width="200px" Height="17px" BorderWidth="1"/>
                <HeaderStyle Wrap="false" Width="1500px" Height="20px"/>
                
                <SelfHierarchySettings ParentKeyName="ReportsTo" KeyName="EmployeeID"/>                
                
            </MasterTableView>
            
            <ClientSettings AllowExpandCollapse="true" EnablePostBackOnRowClick="true">            
            </ClientSettings>
        </telerik:RadGrid>
RadTony
Top achievements
Rank 1
 answered on 03 Feb 2010
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?