Listbox EmptyMessageTemplate rlbEmptyMessage positioning issue

3 posts, 1 answers
  1. Brian
    Brian avatar
    12 posts
    Member since:
    Apr 2012

    Posted 18 Jun 2012 Link to this post

    Hi I have the following aspx code:
    <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
        CodeBehind="Default.aspx.cs" Inherits="TestWebApplication1._Default" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        <telerik:RadListBox ID="RadListBox1" runat="server">
                <asp:Label runat="server" Text="No Items"></asp:Label>

    In my code behind:
    RadListBox1.DataSource = new List<string> {};

    The telerik.web.ui.dll is
    Version: 2011.3.1115.35
    Runtime Version: v2.0.50727

    The empty template get's renders like so: (see attachment)

    I noticed that in the rendered HTML, there's a div with a class called "rlbEmptyMessage"
    .RadListBox .rlbEmptyMessage {
        color: #999999;
        font-style: italic;
        position: absolute;
        text-align: center;

    Now when I remove the position: absolute css style, the emtpy message displays as I think it should. Is this a bug?

    Tested in Firefox 13.0 and and IE 8.0
  2. Answer
    Bozhidar avatar
    1146 posts

    Posted 19 Jun 2012 Link to this post

    Hi Brian,

    The empty message template is intended to work with a ListBox which has a set height. Try setting the Height attribute of the ListBox and you will see that the empty message template is displayed accordingly. 

    However, if you specifically don't want to set the height of the ListBox, you can apply the following css to your page, which resolves the issue:
    .RadListBox .rlbEmptyMessage
        position: static !important;

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Brian
    Brian avatar
    12 posts
    Member since:
    Apr 2012

    Posted 19 Jun 2012 Link to this post

    Thanks Bozhidar, the css override worked exactly like I wanted.
Back to Top