Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
249 views
So this is really simple.  I want to load the same ascx 'x' number of times.  And based on the Session Information, load the page a certain way.  And I have that functionality working perfectly.

However, what happens is while clicking on the tabs.  The radpageviews will no longer load, or be stuck on a previous page. Also, I noticed sometimes when the page renders the multipage it's a child of an already existing multipage.

Below is code for the entire project.  Any help or a way to work with this idea would be fantastic.  Thanks.


All the code I got to load the dynamic pages comes from the online demo.   Thanks!

default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        function onTabSelecting(sender, args) {
            if (args.get_tab().get_pageViewID()) {
                args.get_tab().set_postBack(false);
            }
        }
    </script>
    <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1" Skin="MetroTouch">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" EnablePageHeadUpdate="true">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadMultiPage1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
        Skin="MetroTouch" Align="Justify" Orientation="VerticalLeft" OnTabClick="RadTabStrip1_TabClick"
        Width="1000" OnClientTabSelecting="onTabSelecting">
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" OnPageViewCreated="RadMultiPage1_PageViewCreated">
    </telerik:RadMultiPage>
    <div>
    </div>
    </form>
</body>
</html>

default.aspx.cs
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;

public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session["RSession"] = new RSession.UserSession();
            RadTabStrip_Populating();
        }
    }

    protected void RadTabStrip_Populating()
    {
        string[] tabValues = { "String|A M A|ApplePumpkinButter|MyChoices", "Decimal|Base Happy Go Lucky turtle|BaseHappyGoLuckyturtle|MyHappyFunDay", "Decimal|Base Mountain Slopes|BaseMountainSlopes|MyFunWithTabs", "Decimal|Base Ski Slopes|BaseSkiSlopes|MyFunWithTabs", "Decimal|BaseSkiSlopeAdjustedHight|BaseSkiSlopeAdjustedHight|MoreFunWithTabs" };
        foreach (string tv in tabValues)
        {
            RadTab RT = new RadTab();
            RT.Text = tv.Split('|')[1];
            RT.Value = tv;
            RT.Width = Unit.Pixel(300);
            RadTabStrip1.Tabs.Add(RT);
        }
    }

    protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
    {
        string userControlName = "dynamicbuilder.ascx";

        Control userControl = Page.LoadControl(userControlName);
        userControl.ID = e.PageView.ID.Replace(" ", "").Replace("|", "") + "_userControl";

        e.PageView.Controls.Add(userControl);
    }

    private void AddPageView(RadTab tab)
    {
        RadPageView pageView = new RadPageView();
        pageView.ID = tab.Text.Replace(" ", "");
        RadMultiPage1.PageViews.Add(pageView);
        tab.PageViewID = pageView.ID;
    }

    protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
    {
        ((RSession.UserSession)Session["RSession"]).CurrentParameterDT = e.Tab.Value.ToString().Split('|')[0].ToString();
        ((RSession.UserSession)Session["RSession"]).CurrentParameterFLH = e.Tab.Value.ToString().Split('|')[1].ToString();
        ((RSession.UserSession)Session["RSession"]).CurrentParameterFName = e.Tab.Value.ToString().Split('|')[2].ToString();
        ((RSession.UserSession)Session["RSession"]).CurrentParameterTName = e.Tab.Value.ToString().Split('|')[3].ToString();
        AddPageView(e.Tab);
        e.Tab.PageView.Selected = true;
    }
}

dynamicbuilder.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="dynamicbuilder.ascx.cs"
    Inherits="dynamicbuilder" %>
<asp:Panel ID="Panel_Dec" runat="server" Visible="false">
    <div style="padding-top: 10px;">
        <div style="float: left; padding-left: 15px;">
            <asp:Label runat="server" ID="Label_NumericStartingValue"></asp:Label>
        </div>
        <br />
        <div style="padding-top: 10px;">
            <div style="float: left; padding-left: 15px;">
                <asp:Label runat="server" ID="Label_NumericEndingValue"></asp:Label>
                 
            </div>
</asp:Panel>
<asp:Panel ID="Panel_NV" runat="server" Visible="false">
    <asp:Label runat="server" ID="Label2" Text="nvarchar"></asp:Label>
</asp:Panel>
<asp:Panel ID="Panel_DT" runat="server" Visible="false">
    <div style="padding-top: 10px;">
        <div style="float: left; padding-left: 15px;">
            <asp:Label runat="server" ID="Label_StartDate"></asp:Label>
        </div>
        <br />
        <br />
        <div style="float: left; padding-left: 15px;">
            <asp:Label runat="server" ID="Label_EndDate"></asp:Label>
        </div>
    </div>
</asp:Panel>
<asp:Panel ID="Panel_SP" runat="server" Visible="false">
    <asp:Label runat="server" ID="Label4" Text="Special"></asp:Label>
</asp:Panel>

dynamicbuilder.ascx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class dynamicbuilder : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
        HidePanels();
        string casestatement = ((RSession.UserSession)Session["RSession"]).CurrentParameterDT.ToLower();
        switch (casestatement)
        {
            case ("string"):
                if (SpecialFields.Contains(((RSession.UserSession)Session["RSession"]).CurrentParameterFName.ToLower()))
                {
                    Process_Special();
                }
                else
                {
                    Process_NVarChar();
                }
                break;
            case ("integer"):
                Process_Decimal();
                break;
            case ("decimal"):
                Process_Decimal();
                break;
            case ("datetime"):
                Process_DateTime();
                break;
 
        }
    }
 
    protected void HidePanels()
    {
        string casestatement = ((RSession.UserSession)Session["RSession"]).CurrentParameterDT.ToLower();
        switch (casestatement)
        {
            case ("string"):
                if (SpecialFields.Contains(((RSession.UserSession)Session["RSession"]).CurrentParameterFName.ToLower()))
                {
                    Panel_NV.Visible = false;
                    Panel_DT.Visible = false;
                    Panel_Dec.Visible = false;
                    Panel_SP.Visible = true;
                }
                else
                {
                    Panel_NV.Visible = true;
                    Panel_DT.Visible = false;
                    Panel_Dec.Visible = false;
                    Panel_SP.Visible = false;
                }
                break;
            case ("integer"):
 
                Panel_NV.Visible = false;
                Panel_DT.Visible = false;
                Panel_Dec.Visible = true;
                Panel_SP.Visible = false;
                break;
            case ("decimal"):
                Panel_NV.Visible = false;
                Panel_DT.Visible = false;
                Panel_Dec.Visible = true;
                Panel_SP.Visible = false;
                break;
            case ("datetime"):
                Panel_NV.Visible = false;
                Panel_DT.Visible = true;
                Panel_Dec.Visible = false;
                Panel_SP.Visible = false;
                break;
        }
 
    }
 
    protected void Process_NVarChar()
    {
 
 
    }
    protected void Process_DateTime()
    {
        Label_StartDate.Text = ((RSession.UserSession)Session["RSession"]).CurrentParameterFLH + ": Starting Date";
        Label_EndDate.Text = ((RSession.UserSession)Session["RSession"]).CurrentParameterFLH + ": Ending Date";
    }
    protected void Process_Decimal()
    {
 
        Label_NumericStartingValue.Text = ((RSession.UserSession)Session["RSession"]).CurrentParameterFLH + ": Starting Value";
        Label_NumericEndingValue.Text = ((RSession.UserSession)Session["RSession"]).CurrentParameterFLH + ": Ending Value";
    }
    protected void Process_Special()
    {
 
 
    }
 
    protected string[] SpecialFields = { "mn", "ve" };
}

SessionControl.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
 
public static class RSession
{
 
    public class UserSession
    {
 
        public string CurrentParameterTName
        {
            get;
            set;
        }
 
        public string CurrentParameterFName
        {
            get;
            set;
        }
 
        public string CurrentParameterFLH
        {
            get;
            set;
        }
        public string CurrentParameterDT
        {
            get;
            set;
        }
 
    }
}


Dimitar Terziev
Telerik team
 answered on 12 Nov 2013
7 answers
309 views
Hi,

Currently, I am referencing http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/batchediting/defaultcs.aspx

But I have no idea how to get the red angle dirty mark after changing.

Thank you so much.
Allen
Top achievements
Rank 1
 answered on 12 Nov 2013
6 answers
1.0K+ views

Hi everyone,
I have a problem with formating Y-Axis label, I need to use spanish format for numbers (e.g.: 123.456.789,12)
As you can see in the picture, in the tooltip I can transform the values with javascript function, but i can't use the same metod for Y-Axis Label.

What can I do?



Thanks in advance
Danail Vasilev
Telerik team
 answered on 12 Nov 2013
7 answers
265 views
Hello

Im trying to make the whole image react when the mouse hover on the root menu item, but it actually just take the first 24 pixels of the image or so

here is a sample

<%@ Page Language="VB" AutoEventWireup="false" CodeBehind="TelerikWebForm.aspx.vb" Inherits="WebApplication2.TelerikWebForm" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
    <telerik:RadMenu runat="server">
    <Items>
    <telerik:RadMenuItem Text="" ImageUrl="GDGlobal-95x25.png" Width="95px">
    </telerik:RadMenuItem>
    </Items>
    </telerik:RadMenu>
    </div>
    </form>
</body>
</html>

Any idea what I'm doing wrong?

Thanks
Kate
Telerik team
 answered on 12 Nov 2013
4 answers
175 views
Hi,
I am working on an application set to ES culture. The decimal separator for that culture is ",".
I have a grid with AllowFilteringByColumn="True" and a Decimal column defined as:
<telerik:GridNumericColumn DataField="TestDecimalField" HeaderStyle-Width="80px" HeaderText="Columna decimal" SortExpression="TestDecimalField" UniqueName="TestDecimalField" DataType="System.Decimal" DataFormatString="{0:###,##0.00}" FilterControlWidth="50px"></telerik:GridNumericColumn> 
The grid shows correctly, with the decimals contained in that column with the correct format (example: 0,32). When I try to filter by that column, the filter textBox does allow me to enter data in that format, and does not allow me to enter other separators, like ".". If I enter "0,32" and filter by any criteria, after the postback the filter value appears as "32" and no values are returned. (in the DataSource there are values with 0,32 but not with 32).
Do you know what could be happening? Is this a bug or am I missing something?
I am using RadControls_for_ASP.NET_AJAX_2009_2_701
Thanks,
Guillermo
Pavlina
Telerik team
 answered on 12 Nov 2013
2 answers
304 views
I set the appsetting for the temp folder of the AsynchUpload control in my machine.config file.  It does not seem to work there.  By cutting/pasting into my web.config, the setting seems to be picked up.  So, I know the setting is valid.   It looks like the snippet below.

 <add key="Telerik.AsyncUpload.TemporaryFolder" value="\\SomeDevServer\e$\SomeFolder\temp\" />

While I can leave it in web.config, we find that "unfortunate."  All our file system settings are set in machine.config!  That way we can copy our website files across dev/test/production servers, including web.config without modification.  Now we will have to make custom edits as deploy to different servers.

Any reason why the appsetting can't be inherited from the machine.config value?
Margo Noreen
Top achievements
Rank 1
Iron
Veteran
 answered on 12 Nov 2013
4 answers
190 views
I have implemented the RadHTMLChart as a user control (.ascx) and am adding it to the aspx page on a TabStrip control.  The grid renders just fine, however when I try adding either of the two client side events, OnClientSeriesClicked and OnClientSeriesHover, when the page loads, I receive the following Javascript error:  Microsoft JScript runtime error: 'OnClientSeriesClicked' is undefined.

I have extracted the HTML and C# code onto a separate .aspx page implementing the RadHTMLChart directly with the page and the client event work in that scenario.

What is it about implementing the chart as a user control or having it with a tabstrip control that could be causing the Javascript error?  Is there an attribute/property on the chart control that I need to set?

Thanks.

Joe
Danail Vasilev
Telerik team
 answered on 12 Nov 2013
7 answers
480 views
Help needed.  

  I am having trouble with a the pager on a rad grid. The pager for some reason will not work correctly when using the page arrows to move between pages. It works fine going from page one to page two but it will not go past page two. When I press the next page arrow, the grid flickers as if it is loading the next set of records but returns to showing page two.
  I can click on another page beyond page two, such as page three or page ten, and the grid responds correctly loading that proper records. After clicking on a page beyond page two, such as page six, and then clicking on the next page arrow, the grid returns to showing page two.

Here is some info incase it is needed: 
  .PagerStyle.Mode = Telerik.Web.UI.GridPagerMode.NextPrevAndNumeric
   .PagerStyle.Visible = True
  
.PagerStyle.AlwaysVisible = True
  
  
.AllowCustomPaging = False
   .VirtualItemCount  = 1000

I built the grid in code behind. 

Thanks in advance for any assitance you can provide. 






 
Sue
Top achievements
Rank 1
 answered on 12 Nov 2013
2 answers
164 views

Hi,

I have a RadEditor that is created at runtime. Its forecolor and background fill doesn't response.

How to get it work? Do I have to reference RadEditor to RadEditorContenArea.CSS?

Thanks,

D.



d-cpt
Top achievements
Rank 2
 answered on 12 Nov 2013
1 answer
76 views
Hi,
i have hover style style for my grid, enablerowhover= true. That works fine, i want this effect in edit mode also. Im using inPlace edit, how to have the effect on editmode rows.?
Princy
Top achievements
Rank 2
 answered on 12 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?