Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
143 views
I did the same example:
http://demos.telerik.com/aspnet-ajax/listbox/examples/functionality/transfer/defaultcs.aspx 

I need on double click transfer from right to left listbox.

I did this, but does not work

telerik:RadListBox runat="server" ID="RadListBoxDestination" Height="200px" Width="200px" 
AllowTransferOnDoubleClick="true" TransferToID="RadListBoxSource 
"
 
/>
 


regards

july
Erik
Top achievements
Rank 2
 answered on 09 May 2013
2 answers
149 views
I have a listbox which changes the enabled property of some textbox/combobox controls below it when the selected index is changed.  I have the text/combos in a RadPane which is ajaxified by a RadAjaxManager.  Everything works fine, but after the postback updates the controls in the radpane to enabled/disabled, the controls' border color changes, as if they have received the focus.  Not sure why this is happening..?


<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="ReportListBox">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="MenuPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
 
            </AjaxSettings>
        </telerik:RadAjaxManager>
    <telerik:RadSplitter ID="RadSplitter1" runat="server" Orientation="Vertical" Height="100%" Width="100%" >
                         
<telerik:RadPane ID="SidePane" runat="server" Width="275" MaxWidth="275">
<div id="menu-container">
  <div class="menu-input">                               
    <asp:Label AssociatedControlID="ReportListBox" runat="server" Text="Select Report:"></asp:Label>
    <telerik:RadListBox ID="ReportListBox" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ReportListBox_SelectedIndexChanged"></telerik:RadListBox>
    </div>
<asp:Panel ID="MenuPanel" runat="server">
 
<div class="menu-input"
<asp:Label AssociatedControlID="DateFromPicker" runat="server" Text="From Date:"></asp:Label>
<telerik:RadDatePicker ID="DateFromPicker" runat="server"></telerik:RadDatePicker><br />
</div>
<div class="menu-input"
<asp:Label ID="DateThruLabel" AssociatedControlID="DateThruPicker" runat="server" Text="Thru Date:"></asp:Label>
<telerik:RadDatePicker ID="DateThruPicker" runat="server"></telerik:RadDatePicker> <br />    
</div>
<div class="menu-input"
<asp:Label ID="Label1" AssociatedControlID="DepartmentComboBox" runat="server" Text="Department:"></asp:Label>
<telerik:RadComboBox ID="DepartmentComboBox" runat="server"></telerik:RadComboBox><br />
</div>
<div class="menu-input">   
<asp:Label ID="Label4" AssociatedControlID="CarrierComboBox" runat="server" Text="Carrier:"></asp:Label>
<telerik:RadComboBox ID="CarrierComboBox" runat="server">
</telerik:RadComboBox><br />   
</div>
 <div class="menu-input">   
<asp:Label ID="Label2" AssociatedControlID="ProdBatchComboBox" runat="server" Text="Production Batch:"></asp:Label>
<telerik:RadComboBox ID="ProdBatchComboBox" runat="server">
</telerik:RadComboBox><br />   
</div>
<div class="menu-input">   
<asp:Label AssociatedControlID="SonoTextBox" runat="server" Text="SO#:"></asp:Label>
<telerik:RadTextBox ID="SonoTextBox" runat="server"></telerik:RadTextBox
<telerik:RadButton ID="ClearSonoButton" runat="server" Text="Clear" AutoPostBack="false" OnClientClicked="ClearSonoButton_Clicked"></telerik:RadButton>  
</div>    
                                 
</asp:Panel>
<div class="menu-input">                                   
<telerik:RadButton ID="RunReportButton" runat="server" Text="Run Report" AutoPostBack="true" OnClientClicked="RunReportButton_ClientClicked" OnClick="RunReportButton_Click"></telerik:RadButton>  
</div>             
</div>
</telerik:RadPane>





protected void ReportListBox_SelectedIndexChanged(object sender, EventArgs e)
{                    
    RadListBoxItem selectedRow = ReportListBox.Items[ReportListBox.SelectedIndex];
    int reportId = Convert.ToInt32(selectedRow.Value);
    bool enableDepts = false;
    bool enableStartDate = false;
    bool enableEndDate = false;
    bool enableSono = false;
    bool enableCarrier = false;
    bool enableProdBatch = false;
     
    ReportsDataset.ReportsDataTable rptTable = rptTa.GetDataById(reportId);
 
                 
    foreach (ReportsDataset.ReportsRow row in rptTable.Rows)
    {
        enableDepts = row.flag_dept;
        enableStartDate = row.flag_startdate;
        enableEndDate = row.flag_enddate;
        enableSono = row.flag_sono;
        enableCarrier = row.flag_cb;
        enableProdBatch = row.flag_prodbatch;
    }
 
    DepartmentComboBox.Enabled = enableDepts;
    DateFromPicker.Enabled = enableStartDate;
    DateThruPicker.Enabled = enableEndDate;
    SonoTextBox.Enabled = enableSono;
    CarrierComboBox.Enabled = enableCarrier;
 
}
Steve
Top achievements
Rank 1
 answered on 09 May 2013
1 answer
77 views
Hi,

    How to enable the Mouse wheel on Radrotator.  If I move the mouse wheel down, Rotator should be moved to left side, If I move the mouse wheel up, rotator should be moved to right side.

Browser : IE 8, IE9
Kindly suggest me.

Also, I am not able to set the width of the rotator in percentage (100%). It gave me script error. It is accepting px only,
so, I am facing problem with wider and narrow monitors showing different width size rotator.

Browser : IE 8, IE9
Kindly suggest me.
Slav
Telerik team
 answered on 09 May 2013
1 answer
137 views
Hi,

I am creating raddock controls dynamically based on the data from the database. Everything is working except the state is not changing on the initial postback. It works perfectly afterwards. Am I missing anything? 

I am saving the state to the database after every change. Below is the code snippet of the page and the user control. Please take a look and let me know if I am missing anything. 

TabDash.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/Desktop/MasterPages/Dasboard.master" AutoEventWireup="true" CodeFile="TabDash.aspx.cs" Inherits="Desktop_TabDash" %><br><%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><br><%@ Register TagPrefix="azimaDLI" TagName="Tab1" Src="~/Desktop/Controls/Tab1.ascx" %><br><br><asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"><br></asp:Content><br><asp:Content ID="Content2" ContentPlaceHolderID="mainContent" Runat="Server"><br>    <br>    <script type="text/javascript" src="FusionCharts/FusionCharts.js"></script><br>    <script type="text/javascript" src="Scripts/contextHelp.js?"></script><br><br>    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" /><br>    <br>    <div class="exampleWrapper"><br>        <telerik:RadTabStrip runat="server" ID="RadTabStrip1" Orientation="HorizontalTop"<br>            SelectedIndex="0" MultiPageID="RadMultiPage1" ><br>            <Tabs><br>                <telerik:RadTab Text="Tab 1"></telerik:RadTab><br>                <telerik:RadTab Text="Tab 2"></telerik:RadTab><br>            </Tabs><br>        </telerik:RadTabStrip><br>        <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0" Height="218px"<br>            Width="396px" CssClass="multiPage" OnPageViewCreated="RadMultiPage1_PageViewCreated" >            <br>        </telerik:RadMultiPage><br>    </div><br></asp:Content>

TabDash.aspx.cs
using System;<br>using System.Collections.Generic;<br>using System.Linq;<br>using System.Web;<br>using System.Web.UI;<br>using System.Web.UI.WebControls;<br>using AzimaDLI.Users;<br>using AzimaDLI;<br>using Telerik.Web.UI;<br><br>public partial class Desktop_TabDash : BasePage<br>{<br>    public int selectedPlantId = 0;<br>    private string connString = string.Empty;<br>    private int histPlantId = 0;<br>    private User thisUser = null;<br><br>    protected void Page_Init(object sender, EventArgs e)<br>    {<br>        if (Session != null)<br>        {<br>            connString = Session["ConnString"].ToString();<br>            thisUser = ((User)Session["User"]);<br>        }<br><br>        if (!Page.IsPostBack)<br>        {<br>            LoadPlantsDDL();<br>            AddPageView("Tab1");<br>            AddPageView("Tab2");<br>        }<br>    }<br><br>    private void AddPageView(string tabname)<br>    {<br>        RadPageView pageView = new RadPageView();<br>        pageView.ID = tabname;<br>        RadMultiPage1.PageViews.Add(pageView);<br>    }<br><br>    protected void Page_Load(object sender, EventArgs e)<br>    {<br><br>    }<br>    protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)<br>    {<br>        string userControlName = string.Format("~/Desktop/Controls/{0}.ascx", e.PageView.ID);<br>        Control userCtrl = Page.LoadControl(userControlName);<br>        userCtrl.ID = e.PageView.ID + "_userCtrl";<br>        e.PageView.Controls.Add(userCtrl);<br>    }<br><br>}<br>

Tab1.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Tab1.ascx.cs" Inherits="Desktop_Controls_Tab1" %><br><%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><br><br><telerik:RadDockLayout ID="RadDockLayout1" runat="server" Skin="Metro" <br>     OnSaveDockLayout="RadDockLayout1_SaveDockLayout" ><br>    <table><br>        <tr><br>            <td style="vertical-align: top">                <br>                <telerik:RadDockZone ID="RadDockZone0" runat="server" Orientation="Vertical" Width="350px" <br>                    MinHeight="400px" Style="float: left; margin-right: 20px;"><br>                    <br>                </telerik:RadDockZone><br>            </td><br>            <td style="vertical-align: top"><br>                <telerik:RadDockZone ID="RadDockZone1" runat="server" Orientation="Vertical" Width="350px"<br>                    MinHeight="400px" Style="float: left; margin-right: 20px;"><br>                    <br>                </telerik:RadDockZone><br>            </td><br>            <td style="vertical-align: top"><br>                <telerik:RadDockZone ID="RadDockZone2" runat="server" Orientation="Vertical" Width="350px"<br>                    MinHeight="400px"><br>                    <br>                </telerik:RadDockZone><br>            </td><br>        </tr><br>    </table><br></telerik:RadDockLayout>

Tab1.ascx.cs
using System;<br>using System.Collections.Generic;<br>using System.Linq;<br>using System.Web;<br>using System.Web.UI;<br>using System.Web.UI.WebControls;<br>using AzimaDLI;<br>using AzimaDLI.Users;<br>using Telerik.Web.UI;<br>using System.Text;<br><br>public partial class Desktop_Controls_Tab1 : BaseControl<br>{<br>    public int selectedPlantId = 0;<br>    private string connString = string.Empty;<br>    User thisUser = null;<br><br>    //Store the info about the added docks in the session.<br>    private List<DockState> CurrentDockStates<br>    {<br>        get<br>        {<br>            List<DockState> _currentDockStates = (List<DockState>)Session["CurrentDockStates"];<br>            if (Object.Equals(_currentDockStates, null))<br>            {<br>                _currentDockStates = new List<DockState>();<br>                Session["CurrentDockStates"] = _currentDockStates;<br>            }<br>            return _currentDockStates;<br>        }<br>        set<br>        {<br>            Session["CurrentDockStates"] = value;<br>        }<br>    }<br><br>    protected void Page_Init(object sender, EventArgs e)<br>    {     <br>        if (Session != null)<br>        {<br>            connString = Session["ConnString"].ToString();<br>            thisUser = ((User)Session["User"]);<br>        }<br><br><br>        if (Page.IsPostBack)<br>        {<br>            //UpdateLayoutState();<br>            //Recreate the docks in order to ensure their proper operation<br>            for (int i = 0; i < CurrentDockStates.Count; i++)<br>            {<br><br>                RadDock dock = CreateRadDockFromState(CurrentDockStates[i]);<br>                //We will just add the RadDock control to the RadDockLayout.<br>                // You could use any other control for that purpose, just ensure<br>                // that it is inside the RadDockLayout control.<br>                // The RadDockLayout control will automatically move the RadDock<br>                // controls to their corresponding zone in the LoadDockLayout<br>                // event (see below).<br>                RadDockLayout1.Controls.Add(dock);<br>                //We want to save the dock state every time a dock is moved.<br>                CreateSaveStateTrigger(dock);<br>                //Load the selected widget<br>                if (string.IsNullOrEmpty(dock.Tag) || dock.Closed)<br>                {<br>                    return;<br>                }<br>                Control widget = LoadControl(dock.Tag);<br>                dock.ContentContainer.Controls.Add(widget);<br><br>                if (CurrentDockStates[i].Closed == true)<br>                {<br>                    dock.Visible = false;<br>                }<br>            }<br>        }<br>        else<br>        {<br>            LoadWidgets();<br>        }<br>    }<br><br>    protected void Page_Load(object sender, EventArgs e)<br>    {<br>        <br>    }<br><br>    private void LoadWidgets()<br>    {<br>        //get the list of widgets that the user has<br>        List<WidgetUser> widgetList = WidgetUser.GetWidgetsByPortalUserId(thisUser.PortalUserId, connString);<br>        string title = string.Empty;<br>        string tag = string.Empty;<br>        <br>        //loop through the widgetList<br>        foreach (WidgetUser item in widgetList)<br>        {<br>            switch (item.WidgetId)<br>            {<br>                // customer widget<br>                case 1:<br>                    tag = "~/Desktop/Controls/Widgets/CustomerWidget.ascx";<br>                    title = Session["CID"].ToString();<br>                    CreateWidget(item, tag, title);                    <br>                    break;<br>                case 2:<br>                    tag = "~/Desktop/Controls/Widgets/WatchListWidget.ascx";<br>                    CreateWidget(item, tag, item.WidgetName);<br>                    break;<br>                case 3:<br>                    tag = "~/Desktop/Controls/Widgets/ManualCollectionWidget.ascx";<br>                    CreateWidget(item, tag, item.WidgetName);<br>                    break;<br>                case 4:<br>                    tag = "~/Desktop/Controls/Widgets/OnlineCollectionWidget.ascx";<br>                    CreateWidget(item, tag, item.WidgetName);<br>                    break;<br>                case 5:<br>                    break;<br>                case 6:<br>                    break;<br>                case 7:<br>                    break;<br>            }<br>            <br>        }<br>    }<br><br>    <br>    private void CreateWidget(WidgetUser item, string tag, string title)<br>    {<br>        string id = string.Format("Raddock{0}", item.WidgetId);<br>        //string title = Session["CID"].ToString();<br>        //string tag = "~/Desktop/Controls/Widgets/CustomerWidget.ascx";<br>        RadDock dock = CreateRadDock(id, title, 350, item, tag);<br><br>        Control widget = LoadControl(dock.Tag);<br>        dock.ContentContainer.Controls.Add(widget);<br>        <br>        AddDocktoZone(item.Column, dock);<br><br>        CreateSaveStateTrigger(dock);<br>    }<br><br>    private void AddDocktoZone(int column, RadDock dock)<br>    {<br>        if (column == 0)<br>        {<br>            RadDockZone0.Controls.Add(dock);<br>        }<br>        else if (column == 1)<br>        {<br>            RadDockZone1.Controls.Add(dock);<br>        }<br>        else if (column == 2)<br>        {<br>            RadDockZone2.Controls.Add(dock);<br>        }<br>    }<br><br>    private void CreateSaveStateTrigger(RadDock dock)<br>    {<br>        //Ensure that the RadDock control will initiate postback<br>        // when its position changes on the client or any of the commands is clicked.<br>        //Using the trigger we will "ajaxify" that postback.<br>        dock.AutoPostBack = true;<br>        dock.CommandsAutoPostBack = true;<br>    }<br><br>    private RadDock CreateRadDock(string id, string title, int width, WidgetUser item, string tag)<br>    {<br>        RadDock dock = new RadDock();<br>        dock.DockMode = DockMode.Docked;<br>        dock.UniqueName = item.WidgetUserId.ToString();<br>        dock.ID = string.Format("{0}_{1}", id, dock.UniqueName);<br>        dock.Title = title;<br>        dock.Index = item.Row;<br>        dock.Closed = !item.IsActive;<br>        dock.Collapsed = item.Collapsed;<br>        dock.Width = Unit.Pixel(width);<br>        dock.Tag = tag;<br>        dock.EnableAnimation = true;<br>        dock.Resizable = true;<br>                <br>        dock.Commands.Add(new DockCloseCommand());<br>        dock.Commands.Add(new DockExpandCollapseCommand());<br><br>        return dock;<br>    }<br>    protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)<br>    {<br>        //Populate the event args with the state information. The RadDockLayout control<br>        // will automatically move the docks according that information.<br>        foreach (DockState state in CurrentDockStates)<br>        {<br>            e.Positions[state.UniqueName] = state.DockZoneID;<br>            e.Indices[state.UniqueName] = state.Index;<br>        }<br>    }<br>    protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)<br>    {<br>        CurrentDockStates = RadDockLayout1.GetRegisteredDocksState();<br><br>        //save the layout to the database<br>        for (int i = 0; i < CurrentDockStates.Count; i++)<br>        {<br>            int index = CurrentDockStates[i].DockZoneID.Length-1;<br>            int column = Convert.ToInt32(CurrentDockStates[i].DockZoneID.Substring(index, 1));<br>            bool isActive = !CurrentDockStates[i].Closed;<br>            bool collapsed = CurrentDockStates[i].Collapsed;<br>            int widgetUserId = Convert.ToInt32(CurrentDockStates[i].UniqueName);<br>            WidgetUser.Update(widgetUserId, column, CurrentDockStates[i].Index, isActive, collapsed, connString);<br>        }<br><br>        if (Page.IsPostBack)<br>        {<br>            //LoadWidgets();<br>        }<br>    }<br><br>    private RadDock CreateRadDockFromState(DockState state)<br>    {<br>        RadDock dock = new RadDock();<br>        dock.DockMode = DockMode.Docked;<br>        dock.ID = string.Format("RadDock{0}", state.UniqueName);<br>        dock.ApplyState(state);<br>        dock.Commands.Add(new DockCloseCommand());<br>        dock.Commands.Add(new DockExpandCollapseCommand());<br><br>        return dock;<br>    }<br>}

Thanks,
NK
Nagasree
Top achievements
Rank 1
 answered on 09 May 2013
1 answer
134 views
Hi,

I have coded a page with a RadTabStrip + RadMultiPages embedded in a RadDockLayout (see code sample below), on which I can dynamically add new tabs. Each tab embeds a RadDockZone and when I press my AddDock button it creates a new dock in the currently selected RadDockZone.

<asp:UpdatePanel ID="UPLineManager" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <telerik:RadButton ID="rbtAddLine" runat="server" OnClick="rbtAddLine_Clicked" Text="New">
        </telerik:RadButton>
        <telerik:RadButton ID="ButtonAddStop" runat="server" OnClick="ButtonAddStop_Click"
            Text="Add Stop" />
        <div>
            <telerik:RadDockLayout ID="RdlLineBuilder" runat="server" OnSaveDockLayout="RdlLineBuilder_SaveDockLayout"
                OnLoadDockLayout="RdlLineBuilder_LoadDockLayout">
                <telerik:RadTabStrip ID="rtsLines" runat="server" CssClass="rtsLines" MultiPageID="mpLines"
                    OnTabCreated="rtsLines_TabCreated">
                </telerik:RadTabStrip>
                <telerik:RadMultiPage ID="mpLines" runat="server" CssClass="multiPageViewContent"
                    Height="400" OnPageViewCreated="mpLines_PageViewCreated">
                </telerik:RadMultiPage>
                <telerik:RadAjaxLoadingPanel ID="ralpLines" runat="server">
                </telerik:RadAjaxLoadingPanel>
            </telerik:RadDockLayout>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>


Everything works like a charm here. Although I'm not 100% happy with this.

I can have up to 12 tabs opened at the same time and each of those tabs can host up to 60 docks. ie the Page itself could host up to 624 docks, which is quite heavy I must say.
Therefore I'm trying to get everything done on the client side and avoid pointless postbacks when I can. I disabled the AutoPostBack properties from my docks hence, only the client event OnClientDockPositionChanged is trigger (no postback on DockPositionChanged). This avoids to rebuild the whole bunch of possibly 624 docks every time I move one.
The issue here is obviously if I refresh the page I lose all of my dock states.

My question is as follow: Is there a way to save the DockLayout before the page is being reloaded while AutoPostBack on docks is set to false ? Something like RadDockLayout.RefreshDockLayout() from code behind would be awesome :)
Should I send a big chunk of JSON data (the dockstates) to my server prior to reloading the page ? If so, what would be the best way to do such thing ?

Thanks,

Chris


Slav
Telerik team
 answered on 09 May 2013
6 answers
143 views
Hi,
my problem is when i try to export my grid when it has already been export, my browser freeze. The export format doesn't matter.
But if i close the first export file before export the grid, it works.
It happen only in Internet Explorer. I have version 7.
With Firefox, i can have as many export file that i want at the same time without closing one.

Thank you in advance
Daniel
Telerik team
 answered on 09 May 2013
0 answers
102 views
Hello,

I have a RadToolbar and a div that should load contents of another page using jquery.  Does anyone know why this error occurs:
SysArgumentTypeException
Object of type 'Telerik.Web.UI.RadToolbarCancelEventArgs' cannot be converted to type 'Sys.CancelEventArgs'

Any help would be appreciated!

<telerik:RadScriptManager ID="tmgRSM" runat="server" EnableCdn="true">
            <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>
  
        <telerik:RadToolBar ID="radToolBar1" runat="server"
                Width="100%" EnableViewState="false" OnClientButtonClicking="OnToolBarButtonClick">
                <Items>
                    <telerik:RadToolBarButton Text="Tab1" CommandName="Tab1" CheckOnClick="true" Checked="true"></telerik:RadToolBarButton>
                    <telerik:RadToolBarButton IsSeparator="true"></telerik:RadToolBarButton>
                    <telerik:RadToolBarButton Text="Tab2" CommandName="Tab2" CheckOnClick="true"></telerik:RadToolBarButton>
                </Items
        </telerik:RadToolBar>
          
        <div id="contentDiv" style="padding-left:20px"></div>
  
        <telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
            <script type="text/javascript">
                window.$ = $telerik.$;
  
                $(document).ready(function () {
                    $('#contentDiv').load('Content.aspx');
                });     
  
                function OnToolBarButtonClick(sender, args) {
                    alert(args.get_item().get_commandName());
                }
            </script>
        </telerik:RadCodeBlock>
Cheryl
Top achievements
Rank 1
 asked on 09 May 2013
2 answers
177 views
I am writing an application that creates potentially multiple dynamic charts on a page from parameters saved in a database.  When the page initially loads the charts are created after getting information from the database.  There is a timer on the page that executes a postback and I have code in the "IsPostback" block on page load that calls the function used to create the chart with the same parameters being passed as well as a call to the database to get the new values to update the chart.

I can see that the new values are present when the code is run from the timer postback to create the chart and I can see through fiddler that the image never gets created because "chartimage.axd" never gets called again after the initial non-postback load on the server to be sent back to the browser.  What am I missing to make this work properly?

Thanks for any help that can be provided.

James

Code block run the initial time that chart is successfully created as well as each time after that when the timer fires.
ChartSubpanelsTimer.Enabled = true;
if (ConfigurationManager.AppSettings["ChartUpdateFrequency"] != "")
    ChartSubpanelsTimer.Interval = Convert.ToInt32(ConfigurationManager.AppSettings["ChartUpdateFrequency"])*1000;
 
WpfChartSubpanelProperties chartProps = (WpfChartSubpanelProperties)subPanelProps;
ViewState.Add("__Chart__" + subpanelCount, chartProps);
 
if (chartProps.StreamId.ToString() != Guid.Empty.ToString())
{
    initScript += GetNewDataStreamIdScript(chartProps.StreamId.ToString(), chartProps.DataMappingFilter);
}
 
initScript += string.Format("subpanels[{0}].dataStreams[0] = new dataStreamInfo(); ", subpanelCount);
initScript += string.Format("subpanels[{0}].dataStreams[0].id = '{1}'; ", subpanelCount, chartProps.StreamId.ToString());
initScript += string.Format("subpanels[{0}].dataStreams[0].keyField = '{1}'; ", subpanelCount, chartProps.KeyField);
initScript += string.Format("subpanels[{0}].dataStreams[0].dataMappingFilter = \"{1}\"; ", subpanelCount, chartProps.DataMappingFilter);
 
string strChartName = "";
int iChartWidth = chartProps.Width;
int iChartHeight = chartProps.Height;
int iChartTopPadding = 0;
int iChartLeftPadding = 0;
int iChartTop = chartProps.Top;
int iChartLeft = chartProps.Left;
keyField = chartProps.KeyField;
 
//Set up all common chart properties
RadChart newChart = new RadChart();
//Give chart ID
newChart.ID = chartProps.Name;
//set the background color
newChart.BackColor = chartProps.BackColor;
//set the chart size
newChart.Width = iChartWidth;
newChart.Height = iChartHeight;
//set the border size and color
newChart.Appearance.Border.Width = chartProps.BorderWidth;
newChart.Appearance.Border.Color = chartProps.BorderColor;
 
//Set the Chart Title and Appearance
newChart.ChartTitle.Appearance.Position.AlignedPosition = AlignedPositions.Top;
newChart.ChartTitle.Appearance.Dimensions.AutoSize = false;
newChart.ChartTitle.Appearance.Dimensions.Width = iChartWidth - (chartProps.BorderWidth * 2);
newChart.ChartTitle.Appearance.Dimensions.Height = 30;
newChart.ChartTitle.Appearance.FillStyle.FillType = FillType.Solid;
newChart.ChartTitle.Appearance.FillStyle.MainColor = Color.SaddleBrown;
 
//Set the Chart Title Textblock Properties
newChart.ChartTitle.TextBlock.Text = chartProps.Title;
newChart.ChartTitle.TextBlock.Appearance.TextProperties.Font = new Font(chartProps.TitleFont.Name, chartProps.TitleFont.Size, chartProps.TitleFont.Style);
newChart.ChartTitle.TextBlock.Appearance.TextProperties.Color = Color.White;
newChart.ChartTitle.TextBlock.Appearance.Position.AlignedPosition = AlignedPositions.Top;
 
//Charts don't allow autonscaling so cut it off
newChart.PlotArea.YAxis.AutoScale = false;
newChart.PlotArea.XAxis.AutoScale = false;
 
//Setup the legend
newChart.Legend.Appearance.Location = LabelLocation.OutsidePlotArea;
switch (chartProps.LegendPosition)
{
    case ChartLegendLocation.Right:
        newChart.Legend.Appearance.Position.AlignedPosition = AlignedPositions.Right;       
        break;
    case ChartLegendLocation.Left:
        newChart.Legend.Appearance.Position.AlignedPosition = AlignedPositions.Left;
        break;
    case ChartLegendLocation.Top:
        newChart.Legend.Appearance.Position.AlignedPosition = AlignedPositions.Top;
        break;
    case ChartLegendLocation.Bottom:
        newChart.Legend.Appearance.Position.AlignedPosition = AlignedPositions.Bottom;
        break;
    case ChartLegendLocation.None:
        newChart.Legend.Visible = false;
        break;
}
 
//retrieve data
DataTable data = GetDataStream(chartProps.StreamId, chartProps.DataMappingFilter) ?? new DataTable();
var view = new DataView(data);
 
newChart.Series.ClearItems();
 
if (chartProps.PlotType == ChartPlotType.Graph)
{
    //Set the chart scale MIN and MAX values
    newChart.PlotArea.YAxis.MinValue = chartProps.MinChartValue;
    newChart.PlotArea.YAxis.MaxValue = chartProps.MaxChartValue;
 
    //Loop through and add each series in chart
    foreach (TDS.QuickCOM.ImageProfile.ChartSeriesProperties chartField in chartProps.ChartFields)
    {
        ChartSeries chartSeries = new ChartSeries();
        chartSeries.Appearance.LabelAppearance.Visible = true;
        chartSeries.Name = chartField.Text;
 
        switch (chartField.SeriesType)
        {
            case GridSeriesType.Area:
                chartSeries.Type = ChartSeriesType.Area;
                break;
            case GridSeriesType.Bar:
                //if horizontal bar then
                chartSeries.Type = ChartSeriesType.Bar;
                newChart.SeriesOrientation = ChartSeriesOrientation.Vertical;
                //set the X Axis
                newChart.PlotArea.XAxis.Clear();
                foreach (DataRow dr in data.Rows)
                {
                    newChart.PlotArea.XAxis.AddItem((string)dr[keyField]);
                    chartSeries.AddItem((double)(long)dr[chartField.Field]);
                }
                //configure the tick settings for chart
                ConfigureChartTickSettings(chartProps.TickRatio, newChart);
                //set the Y axis
                 
                 
                break;
            case GridSeriesType.HorizontalBar:
                chartSeries.Type = ChartSeriesType.Bar;
                newChart.SeriesOrientation = ChartSeriesOrientation.Horizontal;
                break;
            case GridSeriesType.Line:
                chartSeries.Type = ChartSeriesType.Line;
                chartSeries.Appearance.LineSeriesAppearance.Color = Color.FromName(chartField.SeriesColor.ToString());
                break;
            case GridSeriesType.Spline:
                chartSeries.Type = ChartSeriesType.Spline;
                chartSeries.Appearance.LineSeriesAppearance.Color = Color.FromName(chartField.SeriesColor.ToString());
                break;
            case GridSeriesType.SplineArea:
                chartSeries.Type = ChartSeriesType.SplineArea;
                break;
        }
 
         
        //add series to chart
        newChart.Series.Add(chartSeries);
    }
 
}
else if (chartProps.PlotType == ChartPlotType.Doughnut)
{
 
 
}
else if (chartProps.PlotType == ChartPlotType.Pie)
{
 
 
}
else if (chartProps.PlotType == ChartPlotType.TimeSeries)
{
 
 
}
 
System.Web.UI.WebControls.Panel ChartPanel = new System.Web.UI.WebControls.Panel();
ChartPanel.Controls.Add(newChart);
RadAjaxManager1.AjaxSettings.AddAjaxSetting(ChartSubpanelsTimer, newChart);
 
//Add RadialGauge object to the div wrapper
ChartPanel.ID = string.Format("StylePanel_{0}", chartProps.Name);
ChartPanel.Height = iChartHeight;
ChartPanel.Width = iChartWidth;
//set style and background image for panel
ChartPanel.Attributes.Add("style", string.Format("background-repeat:no-repeat; position: fixed; top: {0}px; left: {1}px; width: {2}px; height: {3}px; padding-left: {4}px; padding-top: {5}px;", iChartTop, iChartLeft, iChartWidth, iChartHeight, iChartLeftPadding, iChartTopPadding));
 
RadAjaxPanel gaugeAjaxPanel = new RadAjaxPanel();
gaugeAjaxPanel.ID = string.Format("UpdatePanel_{0}", chartProps.Name);
gaugeAjaxPanel.Controls.Add(ChartPanel);
form1.Controls.Add(gaugeAjaxPanel);

 
break;

My HttpHandler sections.
  <httpHandlers>
    <add verb="*" path="Dart.PowerWEB.LiveControls.GetResource.aspx" type="Dart.PowerWEB.LiveControls.ResourceHttpHandler,Dart.PowerWEB.LiveControls" />
    <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
    <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
    <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
    <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
    <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />
  </httpHandlers>
 
<system.webServer>
  <validation validateIntegratedModeConfiguration="false" />
  <modules runAllManagedModulesForAllRequests="true" />
  <handlers>     
    <remove name="ChartImage_axd" />
    <remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
    <remove name="Telerik_Web_UI_DialogHandler_aspx" />
    <remove name="Telerik_RadUploadProgressHandler_ashx" />
    <remove name="Telerik_Web_UI_WebResource_axd" /><add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" />
    <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode" />
    <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode" />
    <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" />
    <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode" />
  </handlers>
 
</system.webServer>
Ves
Telerik team
 answered on 09 May 2013
1 answer
83 views

We have an issue with RadTreeView node text not displaying correctly after a postback if a folder was expanded using ServerSideCallBack after the control was initially bound. In these scenarios any internal nodes that contain HTML formatting in text lose that HTML formatting. PersistLoadOnDemandNodes is set to True.

Specifically, what we have observed is that if  text of a node that was loaded on demand contains HTML (i.e.

node.text = "My Node Text <span class='NewItem'>-New</span>";

) then upon postbacks the node stays expanded, however the text of internal nodes looses all HTML formatting and plain text is displayed. Any nodes that were loaded as expanded on the initial load show correctly and retain internal HTML formatting, only the nodes that were expanded on demand lose their HTML formatting. Is there a workaround to this issue?

Thanks,
Albert

Kate
Telerik team
 answered on 09 May 2013
1 answer
103 views
I'm guessing the RadChart defaults to a cluster bar chart since that's the way it appears in the documentation. I need just need one bar per my data segments. My data is simply a name column and a value. Where am I going wrong here?


 <telerik:RadChart runat="server" ID="rcData" DefaultType="Bar" DataSourceID="sdsData" 
               SeriesOrientation="Horizontal" Width="500px" Height="600px">
              <PlotArea>
                 <XAxis Appearance-ValueFormat="General" DataLabelsColumn="Name"></XAxis>
               </PlotArea>
                <Legend Visible="false"></Legend>
                <ChartTitle Visible="false"></ChartTitle>
             </telerik:RadChart>
Evgenia
Telerik team
 answered on 09 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?