This is a migrated thread and some comments may be shown as answers.

RadTicker missing after data binding

6 Answers 144 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Emily Wong
Top achievements
Rank 1
Emily Wong asked on 23 Jul 2009, 08:32 AM

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.

6 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 28 Jul 2009, 01:41 PM
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.
0
Emily Wong
Top achievements
Rank 1
answered on 30 Jul 2009, 01:03 AM
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.
0
Conrad
Top achievements
Rank 1
answered on 19 Aug 2011, 01:45 AM
from the sample in ticker.zip:

How can you add a hyperlink to each individual article?
0
Fiko
Telerik team
answered on 22 Aug 2011, 11:56 AM
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.
0
ali
Top achievements
Rank 1
answered on 13 Jun 2014, 10:58 AM
<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

0
Slav
Telerik team
answered on 18 Jun 2014, 08:46 AM
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.

 
Tags
Rotator
Asked by
Emily Wong
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Emily Wong
Top achievements
Rank 1
Conrad
Top achievements
Rank 1
ali
Top achievements
Rank 1
Slav
Telerik team
Share this question
or