Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
520 views
Here's a layout of a portion of our site.  We are using Visual Studio 2010, C# 4.0, and Telerik version 2010.1.519.40

Main.Master
 - RadScriptManager (rsmMain)
 - RadAjaxManager (ramMain)
 - RadAjaxLoadingPanel (ralpMain)
 - asp:Panel  (pnlMain, code behind sets ramMain.AjaxSettings.AddAjaxSetting(pnlUpdateMain, pnlUpdateMain, ralpMain);

MainPage.aspx : Main.Master
 - Banner.ascx (with RadTabStrip that loads a separate usercontrol per tab using Page.LoadControl)
   - Tab1.ascx (loaded by default when page loads)
     - InnerControl1.ascx
       - RadScriptBlock with alert('inner control 1');
   - Tab2.ascx
     - InnerControlX.ascx
       - RadScriptBlock with alert('inner control X');

When Tab1.ascx is loaded, all javascript/jquery works for that tab and it's child controls
When we click on the second tab and load Tab2.ascx, none of the javascript has been rendered to the page.

I've found tons of posts about this particular situation, but none have worked that allow any javascript to function inside of the usercontrols.  I've tried:
  • ScriptManager.RegisterClientScriptInclude to inject an external script file into the control
  • ScriptManager.RegisterStartupScript to inject script to run on load

Only thing that has partially worked is placing all of the javascript needed for the dynamic controls on MainPage.aspx.  In this case, I can call functions from the OnClientClick of buttons, but jQuery can't access the controls inside of the usercontrols because of the partial page loads.

Are there any suggestions?

NOTE: Disabling this line of code makes everything work as expected.
  ramMain.AjaxSettings.AddAjaxSetting(pnlUpdateMain, pnlUpdateMain, ralpMain);

Here is a demo you can use to recreate this problem.

AjaxifiedTabDemo.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AjaxifiedTabDemo.aspx.cs" Inherits="AjaxifiedTabDemo" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
    <script type="text/javascript">
        function OnTabSelecting(sender, args) {
            if (args.get_tab().get_pageViewID()) {
                // If this tab is already loaded, stop postback
                args.get_tab().set_postBack(false);
            }
        }    
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" />
    <telerik:RadAjaxLoadingPanel ID="ralpMain" runat="server" />
    <asp:Panel ID="pnlContentMain" runat="server">
        <telerik:RadTabStrip OnClientTabSelecting="OnTabSelecting" ID="rtsDefault" AutoPostBack="true"
            SelectedIndex="0" runat="server" MultiPageID="rmpDefault"
            OnTabClick="rtsDefault_TabClick">
            <Tabs>
                <telerik:RadTab Text="Tab 1" />
                <telerik:RadTab Text="Tab 2" />
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="rmpDefault" runat="server" SelectedIndex="0" OnPageViewCreated="rmpDefault_PageViewCreated">
        </telerik:RadMultiPage>
    </asp:Panel>
    </form>
</body>
</html>

AjaxifiedTabDemo.aspx.cs
using System;
using System.Web.UI;
using Telerik.Web.UI;
 
public partial class AjaxifiedTabDemo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadAjaxManager1, pnlContentMain, ralpMain);
        if (!Page.IsPostBack) AddPageView(rtsDefault.FindTabByText("Tab 1"));
    }
 
    protected void rtsDefault_TabClick(object sender, RadTabStripEventArgs e)
    {
        // Client side code will block this event if this tab has already been created.
        AddPageView(e.Tab);
        e.Tab.PageView.Selected = true;
    }
 
    protected void rmpDefault_PageViewCreated(object sender, RadMultiPageEventArgs e)
    {
        string controlName = (e.PageView.ID == "Tab1") ? "Tab1Control.ascx" : "Tab2Control.ascx";
        Control tabUserControl = Page.LoadControl(controlName);
        tabUserControl.ID = e.PageView.ID + "_userControl";
        e.PageView.Controls.Add(tabUserControl);
    }
 
    private void AddPageView(RadTab tab)
    {
        RadPageView pageView = new RadPageView { ID = tab.Text.Replace(" ", "") };
        pageView.Attributes["controlLoaded"] = "0";
        rmpDefault.PageViews.Add(pageView);
        tab.PageViewID = pageView.ID;
    }
}

Tab1Control.ascx -- nothing in code behind but empty Page_Load()
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Tab1Control.ascx.cs" Inherits="RadControlsWebApp1.Tab1Control" %>
<%@ Register TagPrefix="uc" TagName="InnerControl1" Src="~/InnerControl1.ascx" %>
<uc:InnerControl1 id="ucInnerControl" runat="server"></uc:InnerControl1>
This is Tab 1
 
<telerik:RadScriptBlock ID="rsbTab1" runat="server">
    <script language="javascript" type="text/javascript">
        function tab1Click(sender) {
            alert('thanks for clicking a button on tab 1!  ' + sender.id);
            return false;
        }
    </script>
</telerik:RadScriptBlock>
 
<asp:Button ID="btnOnTab1" runat="server" Text="Button in tab 1" OnClientClick="return tab1Click(this);" />

Tab2Control.ascx -- nothing in code behind but empty Page_Load()
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Tab2Control.ascx.cs" Inherits="RadControlsWebApp1.Tab2Control" %>
<%@ Register TagPrefix="uc" TagName="InnerControl2" Src="~/InnerControl2.ascx" %>
<uc:InnerControl2 id="ucInnerControl2" runat="server"></uc:InnerControl2>
This is Tab 2
 
<telerik:RadScriptBlock ID="rsbTab2" runat="server">
    <script language="javascript" type="text/javascript">
        function tab2Click(sender) {
            alert('thanks for clicking a button on tab 2!  ' + sender.id);
            return false;
        }
    </script>
</telerik:RadScriptBlock>
 
<asp:Button ID="btnOnTab2" runat="server" Text="Button in tab 2" OnClientClick="return tab2Click(this);" />

InnerControl1.ascx -- nothing in code behind but empty Page_Load()
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="InnerControl1.ascx.cs"
    Inherits="RadControlsWebApp1.InnerControl1" %>
<telerik:RadScriptBlock ID="rsbInnerControl" runat="server">
    <script language="javascript" type="text/javascript">
        function internalClick(sender) {
            alert('thanks for clicking me!  ' + sender.id);
            return false;
        }
    </script>
</telerik:RadScriptBlock>
<asp:Button ID="btnInnerButton" runat="server" Text="Button in inner control 1" OnClientClick="return internalClick(this);" />

InnerControl2.ascx -- nothing in code behind but empty Page_Load()
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="InnerControl2.ascx.cs"
    Inherits="RadControlsWebApp1.InnerControl2" %>
<telerik:RadScriptBlock ID="rsbInnerControl2" runat="server">
    <script language="javascript" type="text/javascript">
        function internalClick2(sender) {
            alert('thanks for clicking me on tab 2!  ' + sender.id);
            return false;
        }
    </script>
</telerik:RadScriptBlock>
<asp:Button ID="btnInnerButton" runat="server" Text="Button in inner control 2" OnClientClick="return internalClick2(this);" />
Thad
Top achievements
Rank 2
 answered on 02 Nov 2010
2 answers
409 views
I'm populating a DataTable at runtime, which is the DataSource for a RadGrid.  It uses paging, and I've set IgnorePaging="true" in ExportSettings of the grid.  Yet, it exports only the current page and not the entire DataTable.

Your help is very much appreciated.
Kaiser
Top achievements
Rank 1
 answered on 02 Nov 2010
1 answer
278 views
Hi,

I store inflation percentages as values between 0-1 in my database (e.g. 0.03 would equal 3%) and use a DataFormatString to display the data correctly in the gird- {0:#.#%}.

Whilst this works for displaying the percentages in the grid, I use RadNumericTextBoxes in a popup edit form and set the type to Percent but the values are being displayed as 0.03. Is there any way to format the NumericTextboxes to display the values in the same way as the grid?

Thanks

JH
Pavlina
Telerik team
 answered on 02 Nov 2010
4 answers
156 views
Hi folks

I'm trying to get to grips with using RadEditor, but I'm having trouble with what I believe is a rendering/CSS issue. Could anybody tell me what I'm doing wrong? I have a RadEditor that refuses to display itself properly in Firefox, with the Content area not displayed - this appears to be because the markup generated for the corresponding TEXTAREA element is styled with display:none; which according to Firebug is originating from an element.style style - this looks like some default styling, which makes me think that I have missed an important CSS component from my ASP.NET code for the control:

<trk:RadEditor ID="radCommentEditor1" runat="server" EditModes="Design" Visible="true"
CssClass="~/stylesheets/trk/Editor.Default.css"
ContentAreaCssFile="~/stylesheets/trk/EditorContentArea_RTL.css"
TableLayoutCssFile="~/stylesheets/trk/TableLayoutCss.css"
Width="500px" Height="200px" Skin="Simple" Enabled="true" AutoResizeHeight="True"
ForeColor="SteelBlue" MaxHtmlLength="250" MaxTextLength="250"
Font-Names="Arial" Font-Size="Small"  >
<Content>
<p>Type here</p>
</Content>
<Tools>
          <trk:EditorToolGroup>
                    <trk:EditorTool Name="Bold" />
                    <trk:EditorTool Name="Italic" />
                    <trk:EditorTool Name="Underline" />
                     <trk:EditorTool Name="Cut" />
                    <trk:EditorTool Name="Copy" />
                    <trk:EditorTool Name="Paste" />
                    <trk:EditorTool Name="Undo" />
                    <trk:EditorTool Name="Redo" />
                    <trk:EditorSeparator />
                    <trk:EditorTool Name="Zoom" />
                    <trk:EditorTool Name="AjaxSpellCheck" />
                </trk:EditorToolGroup>
            </Tools>
</trk:RadEditor>

Given that all the stated stylesheets have been copied from the demo styles, i what else should I be including to get the content to display properly?

The problem is even worse in IExplorer, with the toolbar also failing to render, so I'm definitely going wrong somewhere, but I can't seem to find a lead in any of the documentation or examples!

Can anybody point me in the right direction, or suggest a better guide to coding for the RadEditor?

Thanks very much in advance

Regards


Paul Robertson
Top achievements
Rank 1
 answered on 02 Nov 2010
1 answer
97 views
I am getting an Internet Explorer cannot display the webpage when I try to upload an excel spreadsheet, the error is really specific to this excel spreadsheet.

The sheet is not that big 54kb but contains links and a lot of formulas.

Trying to pinpoint the issue from the original page webpage I did a really simple page, the radUpload control and 1 button with no code behind. If I choose the file and click the button I get "Internet Explorer cannot display the webpage".

If I edit the excel spreadsheet to remove all links/formulas and redo the upload everything works great (no "Internet Explorer cannot display the webpage").

Any help would be appreciated as the excel file needs to be uploaded as is with links and formulas.

Thanks
Alex
Top achievements
Rank 2
 answered on 02 Nov 2010
6 answers
157 views
I'm trying to present a boolean column from a MySql table graphically with a GridImageColumn.  I added a the GridImageColumn (myauth) and set it to emulate the boolean column (authorized).  (myauth) GroupByExpression="Group By authorized" and SortExpression="authorized". 

This works well, I can click on the (myauth) column header to change the sorting of the column, and I can drag the (myauth) column header to the group panel and group records.  If however I try to click the sort icon on the (myauth) button added to the group panel, then the button is reduced to just a few pixels, and I loose the ability to group, ungroup, or sort by that column or any others on the grid.


<%@ Page Language="Oxygene" AutoEventWireup="true" CodeBehind="Default.aspx.pas" Inherits="RadGridGroupSortTest._Default" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="Devart.Data.MySql.Web, Version=5.50.79.0, Culture=neutral, PublicKeyToken=09af7300eec23701" Namespace="Devart.Data.MySql.Web" TagPrefix="cc1" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2010.1.519.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 
 
<head runat="server">
  <title>Untitled Page</title>
</head>
 
<body>
  <form id="form1" runat="server">
  <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True">
  </telerik:RadScriptManager>
  <div>
 
    <cc1:MySqlDataSource ID="MySqlDataSource1" runat="server" ConnectionString="User Id=livewire3server;Password=lw3server;Host=192.168.1.5;Database=livewire3;Persist Security Info=True;"
      OldValuesParameterFormatString="Original_{0}" SelectCommand="select id,sender,receiver,authorized from dummydata_testbank" DeleteCommand="DELETE FROM livewire3.dummydata_testbank WHERE ((id = :Original_id))"
      InsertCommand="INSERT INTO livewire3.dummydata_testbank (sender, receiver, authorized) VALUES (:sender, :receiver, :authorized)" UpdateCommand="UPDATE livewire3.dummydata_testbank SET sender = :sender, receiver = :receiver, authorized = :authorized WHERE ((id = :Original_id))">
      <DeleteParameters>
        <asp:Parameter Name="Original_id" Type="String" />
      </DeleteParameters>
      <UpdateParameters>
        <asp:Parameter Name="sender" Type="String" />
        <asp:Parameter Name="receiver" Type="String" />
        <asp:Parameter Name="authorized" Type="Byte" />
        <asp:Parameter Name="Original_id" Type="String" />
      </UpdateParameters>
      <InsertParameters>
        <asp:Parameter Name="sender" Type="String" />
        <asp:Parameter Name="receiver" Type="String" />
        <asp:Parameter Name="authorized" Type="Byte" />
      </InsertParameters>
    </cc1:MySqlDataSource>
 
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="MySqlDataSource1" GridLines="None" ShowGroupPanel="True">
      <MasterTableView DataKeyNames="id" DataSourceID="MySqlDataSource1">
        <RowIndicatorColumn>
          <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
          <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
          <telerik:GridBoundColumn DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id" UniqueName="id">
          </telerik:GridBoundColumn>
          <telerik:GridBoundColumn DataField="sender" HeaderText="sender" SortExpression="sender" UniqueName="sender">
          </telerik:GridBoundColumn>
          <telerik:GridBoundColumn DataField="receiver" HeaderText="receiver" SortExpression="receiver" UniqueName="receiver">
          </telerik:GridBoundColumn>
          <telerik:GridBoundColumn DataField="authorized" DataType="System.Int16" HeaderText="authorized" SortExpression="authorized" UniqueName="authorized">
          </telerik:GridBoundColumn>
          <telerik:GridImageColumn GroupByExpression="Group By authorized" HeaderText="myauth" SortExpression="authorized" UniqueName="myauth">
          </telerik:GridImageColumn>
        </Columns>
      </MasterTableView>
      <ClientSettings AllowDragToGroup="True">
      </ClientSettings>
    </telerik:RadGrid>
 
  </div>
  </form>
</body>
 
</html>


Raymond Andrews
Top achievements
Rank 1
 answered on 02 Nov 2010
1 answer
107 views
Hi,
I've got a problem with Tooltip on chart bar, i will describe how I use it.
I've got application which uses Telerik popups for showing content (other pages through iframe).

One page contains chart with click able bars and I added tooltip for each bar. I use Telerik tooltip manager.
In general it works fine, but there is one problem which causes only in IE 8. When I maximaze popup, tooltip is not shown.
In IE7, FF, it works fine.

Do you have any idea where could be a problem?
Thanks a lot for answer or suggestions.

Radoslav Robes
Svetlina Anati
Telerik team
 answered on 02 Nov 2010
1 answer
176 views
Hi,

Now RadAjaxLoadingPanel is rendered in browser in main div containing two child divs.One for Image with class raDiv and other to disable page with class raColor raTransp.

Now i have a RadMenu in my page which has default z-index to 7000 now how to set the z-index to div with class raColor raTransp to z-index more than 7000 so that it appears above of RadMenu.

Thanks in advance for helping...
Dimo
Telerik team
 answered on 02 Nov 2010
6 answers
197 views
Hi ,
                 I am using Radupload control for uploading multiple files .
I have set the ControlObjectsVisibility property of upload control as Default" .
So in the upload control there is check box for each file . I just want these check box to
checked by default( it is not checked by default ) . It will be really helpful if there is a way to do that .



Regards,
Sankardeep.V
Associate Software Engineer
Digital Mesh Pvt Limited
Genady Sergeev
Telerik team
 answered on 02 Nov 2010
1 answer
95 views
I have a dataset that is return to my ASPX page to be used by a RadListView Control. 

messageListCurrent.DataSource = LoadData(

True)         'this is the dataset

 

messageListCurrent.DataBind()


Now I need to access the columns and set up the ItemTemplate for RadListView in code, not in design view.  How do I do this????  I can not find any examples of this.
Vasil
Telerik team
 answered on 02 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?