Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
230 views

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.

Slav
Telerik team
 answered on 18 Jun 2014
1 answer
403 views
I am trying to change change axis, chart title and points from client side but i can't able to  find any properties for this from client side. Is this possible to change these values from client side?
Danail Vasilev
Telerik team
 answered on 18 Jun 2014
4 answers
125 views
Hi.

I've developed a page with a RadGrid, sourced by a List of POCO's, using an EditFormType of WebUserControl.  My user control handles the DataBinding event (attaching to it in the control's Page_Load(), if that's important).  I click my edit button in the grid... the control pops up, mostly with populated data.  I seem to at least be doing something right...

The one input in the user control I can't seem to get populated is the drop-down, which I've tried implementing as both a plain old ASP.NET DropDownList or a RadComboBox.  If I debug and step through my DataBinding handler.  I can see that it's been properly selected.  But sometime between the end of the DataBinding() call and rendering, the list has lost its selection, and renders showing the first item in the dropdown.

The grid itself is inside a RadAjaxPanel, but I it doesn't appear to be an ajax issue because the problem persists when I set the panel's EnableAjax=false.

All I'm doing to select an item is:

public void SelectBU(string s)
{
    lstBU.ClearSelection();
    lstBU.FindItemByValue(s).Selected = true;
}

The function that databinds the list itself checks the item-count of the list, and skips the data binding if there are already items.  So it's not losing the selection due to an extra bind.

If I just throw this control on a blank page and call SelectBU() from the .aspx codebehind, it works fine.

I'm on 2014.1.225.40 in ASP.NET 4.0, and I'm targeting IE9 primarily.  (I've seen this same behavior in the versions of Chrome and Firefox I have installed on my box.)

Thanks for any guidance anyone can provide.



Princy
Top achievements
Rank 2
 answered on 18 Jun 2014
10 answers
132 views
I'm using OLAP connection to pivot grid. I have noticed that all of my attributes in dimensions are listed in "more fields" group. i don't want that grouping. (excel it doesn't group that way)

Regards,
Yohan
Maria Ilieva
Telerik team
 answered on 18 Jun 2014
4 answers
220 views
I am using this code:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadComboBox1">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel" />
            <telerik:AjaxUpdatedControl ControlID="Label1" />
        </UpdatedControls>
    </telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
 
<telerik:RadAjaxPanel ID="RadAjaxPanel" runat="server">
    
    <telerik:RadComboBox ID="RadComboBox1" runat="server"
        onselectedindexchanged="RadComboBox1_SelectedIndexChanged" AutoPostBack="True">
        <Items>
            <telerik:RadComboBoxItem runat="server" Text="item1"
                Value="RadComboBoxItem1" />
            <telerik:RadComboBoxItem runat="server" Text="item2"
                Value="RadComboBoxItem2" />
            <telerik:RadComboBoxItem runat="server" Text="item3"
                Value="RadComboBoxItem3" />
            <telerik:RadComboBoxItem runat="server" Text="item4"
                Value="RadComboBoxItem4" />
            <telerik:RadComboBoxItem runat="server" Text="item5"
                Value="RadComboBoxItem5" />
            <telerik:RadComboBoxItem runat="server" Text="item6"
                Value="RadComboBoxItem6" />
        </Items>
    </telerik:RadComboBox>
 
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
 
</telerik:RadAjaxPanel>

inside a .ascx file and I keep getting the 'The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>) ' error.  Any suggestion on how to fix this?


Maria Ilieva
Telerik team
 answered on 18 Jun 2014
1 answer
204 views
Hi,

I updated my RadTabStrip and RadMultiPage controls ajax manager per this - http://demos.telerik.com/aspnet-ajax/tabstrip/examples/application-scenarios/ajax-enabled-tabstrip-and-multipage/defaultcs.aspx

But now on one of the .ascx pages where I have several Ajaxified RadGrids the controls in the grid won't post? The ajaxmanager on the page is question looks like this:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
             <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
                    <UpdatedControls>  
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />  
                                <telerik:AjaxUpdatedControl ControlID="RadGrid3" />  
                                <telerik:AjaxUpdatedControl ControlID="RadGrid4" />  
                    </UpdatedControls>  
                </telerik:AjaxSetting>  
            <telerik:AjaxSetting AjaxControlID="RadGrid4">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadWindow1" />
                    <telerik:AjaxUpdatedControl ControlID="RadWindow2" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid3" UpdatePanelCssClass="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadWindow2" />
                    <telerik:AjaxUpdatedControl ControlID="Label1" UpdatePanelCssClass="" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelCssClass="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" UpdatePanelCssClass="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
Maria Ilieva
Telerik team
 answered on 18 Jun 2014
7 answers
361 views
Dear All,

I've been struggling to make RadGrid work with UseStaticHeaders and FrozenColumnsCount properties set. It was working yesterday before we introduced any client-side functionality and today we realized that it wasn't working correctly.

With hours of research in Google, we were not able to find any remedy for the behaviour.

Issue
Column headers won't scroll horizontally in RadGrid although following parameters are set :
AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" FrozenColumnsCount="1"

Remedy
During our development, we have assigned grid's ClientIDMode="Static". Having a static ClientID was the cause of this wierd problem. Once removed, horizontal scrolling was back to normal (as well as frozen columns).

Maybe it will help someone with similar issue.

Kind Regards,

OZAN GUNCELER
Vasil
Telerik team
 answered on 18 Jun 2014
5 answers
243 views
orgchart with image i have to show the images but problem is condition based visible true/false the images 
   
 please provide me sample code 
Plamen
Telerik team
 answered on 18 Jun 2014
8 answers
895 views
Hi,

For this:

<telerik:GridTemplateColumn 
    UniqueName="Value" 
    HeaderText="Values">      
    <HeaderTemplate>     
        <asp:Label 
            Text="Value" 
            runat="server">
        </asp:Label>     
    </HeaderTemplate>     
    <ItemTemplate>     
        <asp:Label 
            ID="CurrentValues" 
            runat="server" 
            Text='<%# Eval("Values") %>'>
        </asp:Label>     
    </ItemTemplate>     
    <EditItemTemplate>     
        <telerik:RadListBox 
            ID="Values" 
            runat="server" 
            DataTextField="ValueTitle" 
            DataValueField="ValueId">
        </telerik:RadListBox>     
    </EditItemTemplate>     
</telerik:GridTemplateColumn>

On firing, OnItemDataBound, this works:

var gridEditFormItem = (GridEditFormItem)e.Item;
  
var radListBox = (RadListBox)gridEditFormItem["Value"].FindControl("Values");

But this does not (Label is null):

var label = (Label)gridEditFormItem["Value"].FindControl("CurrentValues");

I can't see the wood for the trees, I think. Why can't I get a reference to the label?

Thanks,
Richard
Shinu
Top achievements
Rank 2
 answered on 18 Jun 2014
1 answer
87 views
I've got radgrid control which is inside a user ascx file. I'm doing this because I should use radgrid in mvc(so there is no other way - is should wrap it in user control)3

So can someone help me - is it possible to show the nesteditemtemplate because when I click the button infront of each row nothing happens



<%@ Control Language="C#" AutoEventWireup="true" Inherits="MvcBeaWeb.ProductsShowTile" CodeFile="ProductsShowTile.ascx.cs" %>
<%@ Import Namespace="MvcBeaWeb" %>
<%@ Register Assembly="Telerik.Web.UI" TagPrefix="telerik" Namespace="Telerik.Web.UI" %>
<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>


<form id="form_TilesShow" runat="server">

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" >
</telerik:RadScriptManager>
  
     <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanelTilesShow" LoadingPanelID="RadAjaxLoadingPanelTilesShow"
         HorizontalAlign="Center"   Width="472px" >
         <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="radGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
         <div class="mainHolder">
                 <div class="qsf-ib tileListHolder">        
                      <telerik:RadGrid runat="server" OnPreRender="RadGrid1_PreRender" OnItemCommand="RadGrid1_ItemCommand" OnNeedDataSource="RadGrid1_NeedDataSource" ID="RadGrid1" AutoGenerateColumns="false" AllowCustomPaging="true" AllowPaging="true" PageSize="3" OnPageIndexChanged="RadGrid1_PageIndexChanged1">                        <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom"  PageSizeControlType="RadComboBox" ></PagerStyle>
                             <MasterTableView>
                                <Columns>
                                      <telerik:GridBoundColumn DataField="ArticlegroupID"  UniqueName="101">                           
                                      </telerik:GridBoundColumn>
                                 
                                       <telerik:GridBoundColumn DataField="SpecialWord" HeaderText="ProductDescription" UniqueName="200" >
                                       </telerik:GridBoundColumn>  
                                       <telerik:GridImageColumn DataType="System.String" DataImageUrlFields="ImageFile"  UniqueName="500"
                                            AlternateText="Customer image" 
                                            ImageAlign="Middle" ImageHeight="100px" ImageWidth="82px" HeaderText="Image Column">
                                       </telerik:GridImageColumn>   
                                </Columns>
                               

                            <NestedViewTemplate>

                        <div class="carBackground">

                            <div style="float: left; padding-left: 40px">

                                <asp:Image ID="CarImage" runat="server" AlternateText="Car Image" ImageUrl='Images/logoIcon.jpg' />

                            </div>

                            <div style="float: right; width: 50%">

                                <div class="carTitle">

                                   

                                </div>

                              </NestedViewTemplate>
                             </MasterTableView>
                       
                          

                      </telerik:RadGrid>    
                                                                   
                 </div>
         </div>
     </telerik:RadAjaxPanel> 
    
</form>
Princy
Top achievements
Rank 2
 answered on 18 Jun 2014
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?