RadTicker missing after data binding

7 posts, 0 answers
  1. Emily Wong
    Emily Wong avatar
    2 posts
    Member since:
    Jul 2009

    Posted 23 Jul 2009 Link to this post

    I would like to display real-time message from database on top of main page in my project so that I can view it anytime when I navigate other webpages. I manage to bind the updated message in dataset but the RadTicker is missing from the page. Below is the workaround that I have done in my project.

     

    Currently, I'm using RadAjaxTimer to trigger RadTicker to update the message when there is any new message added into database. I created these 2 controls and script manager in ascx page as global user controls in my project. Then, I'll call these reference controls in a RadAjaxPanel on the main page and bind the updated message in RadTicker on ascx page Page_Load event and RadAjaxTimer_Tick event. I only see AjaxLoadingPanel displays during data binding and the RadTicker is missing from the main page after it is done. What happens to the RadTicker? Does it cause by System.Threading.Thread.Sleep(5000) that I configured in RadAjaxTimer_Tick event? Is it used to control the AjaxLoadingPanel display time?

     

     

    Below is the ascx page that I created in my project.

     

    <%

    @ register tagprefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" %>

     

    <%

    @ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="radA" %>

     

    <%

    @ Control Language="C#" AutoEventWireup="true" CodeBehind="Ticker.ascx.cs" Inherits="ACE.ACETM.GlobalWebUI.Ticker" %>

     

    <%

    @ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

     

     

    Namespace="System.Web.UI" TagPrefix="asp" %>

     

     

     

     

    <

     

    div style="COLOR: crimson; BACKGROUND-COLOR: black">

     

     

        <asp:ScriptManager ID="ScriptManager1" runat="server">

     

     

        </asp:ScriptManager>    

     

     

        <telerik:RadTicker id="RadTicker1" runat="server" AutoStart="true" loop="true" AutoAdvance="true" AutoPostBack="true">

     

     

        </telerik:RadTicker>

     

     

     

        <radA:RadAjaxTimer ID="RadAjaxTimer1" runat="server" Interval="10000" OnTick="RadAjaxTimer1_Tick" />

     

    </

     

    div>

     

    public

     

    partial class Ticker : System.Web.UI.UserControl

     

     

     

     

    {

     

        public MessageCenterDS msgCenterDS;

     

     

        protected void Page_Load(object sender, EventArgs e)

     

        {

     

            if (!IsPostBack)

     

            {

     

                MessageCenterBR BF = new MessageCenterBR();

     

                msgCenterDS = BF.GetTestMessages(

    "ABC");

     

                RadTicker1.DataSource = msgCenterDS.MC_MESSAGES;

                RadTicker1.DataTextField =

    "MC_MESSAGE";

     

                RadTicker1.DataBind();

            }
        }

     

        protected void RadAjaxTimer1_Tick(object sender, Telerik.WebControls.TickEventArgs e)

     

        {

            System.Threading.

    Thread.Sleep(5000);

     

     

            MessageCenterBR BF = new MessageCenterBR();

     

            msgCenterDS = BF.GetTestMessages(

    "ABC");

     

            RadTicker1.DataSource = msgCenterDS.MC_MESSAGES;

            RadTicker1.DataTextField =

    "MC_MESSAGE";

     

            RadTicker1.DataBind();

        }

    }

     

    Below is the main page that I created in my project.

     

     

     

     

    <%

    @ register tagprefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" %>

     

    <%

    @ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="radA" %>

     

    <%

    @ Register TagPrefix="uc2" TagName="Ticker" Src="~/common/usercontrols/Ticker.ascx" %>

     

     

     

    <

     

    table border="0" cellpadding="0" cellspacing="0" width="100%" style="height:100%" class="tblBackground">

     

        <

     

    tr>

     

     

            <td colspan="3" align="center"> 

     

     

                <div>

     

     

                    <radA:RadAjaxPanel ID="RadAjaxPanel1" Visible="true" runat="server" LoadingPanelID="AjaxLoadingPanel1" EnableAJAX="true">

     

     

                            <uc2:Ticker id="Ticker1" runat="server" OnLoad="Timer1_Load" />
                     </radA:RadAjaxPanel>
                     <
    radA:AjaxLoadingPanel ID="AjaxLoadingPanel1" runat="server" Height="75px" Width="75px">

     

     

                         <img alt="loading..." src="RadControls/AjaxTimer/Skins/Default/loading.gif" />

     

     

     

                     </radA:AjaxLoadingPanel>

     

     

                 </div>
            
    </td>
        
    </tr>

     

     

    </

     

    table>

     

    protected

     

    void Timer1_Load(object sender, EventArgs e)

     

    {

    }

    Please advice if I have done anything wrong in the coding. I need a solution urgently. I appreciate if you may provide a sample project for me. Thank you.

    Regards,
    Emily.

  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 28 Jul 2009 Link to this post

    Hello Emily,

    I used the provided code and prepared a test project, but I was not able to reproduce any problems. Could you please open a new support ticket and send us a sample which reproduces the behavior that you experience? For your convenience I have attached my test project to the thread and you could just modify it and send it back? Once I have a better view over the problem I will do my best to help.

    Kind regards,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Emily Wong
    Emily Wong avatar
    2 posts
    Member since:
    Jul 2009

    Posted 29 Jul 2009 Link to this post

    Hi Fiko,

    I'm glad to receive your reply. Thank you so much for your help. I'm surprise that you didn't encounter this problem when you are using the same set of coding. I only can see the messages running in ticker on page load but the update function is working fine when I debug the program. Well, let me try it again by using your sample project. Hopefully, it can work properly this time. Anyway, I really appreciate your time and effort for helping me. :)

    Regards,
    Emily.
  5. Conrad
    Conrad avatar
    1 posts
    Member since:
    Jun 2011

    Posted 18 Aug 2011 Link to this post

    from the sample in ticker.zip:

    How can you add a hyperlink to each individual article?
  6. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 22 Aug 2011 Link to this post

    Hi Conrad,

    You should first set the needed URLs in the data objects list:
    object[] array = new object[] { new { Text = "AAAA", Url = "http://www.google.com" }, new { Text = "BBBB", Url = "http://www.bing.com" }, new { Text = "CCCCC", Url = "http://www.yahoo.com" } };

    After that you should set the DataNavigateUrlField property of the RadTicker to Url, i.e. just as the property of each DataItem.

    Hope this helps.

    All the best,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. ali
    ali avatar
    1 posts
    Member since:
    Mar 2009

    Posted 13 Jun 2014 in reply to Fiko Link to this post

    <telerik:RadTicker AutoStart="true" runat="server" ID="Radticker1" DataSourceID="SqlDataSource1"
    DataTextField="txtTitle" DataNavigateUrlField="ShowAllNews.aspx?n=codeNews"
    Loop="true" >

    </telerik:RadTicker>


    <asp:SqlDataSource
    ID="SqlDataSource1"
    runat="server"
    ConnectionString="<%$ ConnectionStrings:dbconnection %>"
    SelectCommand="SELECT txtTitle,codeNews FROM [tblNews] where Chkconsul=1 order by rate desc,codeNews desc">
    </asp:SqlDataSource>when i running this code Error : DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ShowAllNews'. I want send codeNews to ShowAllNews page when clic on txtTitle please help

  8. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 18 Jun 2014 Link to this post

    Hello Ali,

    You need to specify a data source field that contains a URL in the DataNavigateUrlField property of RadTicker. Currently you have set an actual URL, which causes the error.

    You can either create a field with the desired URL in your data source or you can attach a handler to the OnDataBound server-side event of the ticker, access its item via its Items collection and change the NavigateUrl property of each item manually on the server.

    Regards,
    Slav
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017