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

In IE7 Only - With Multiple RadListBoxes, they disappear but still in HTML markup

1 Answer 41 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Jason Sweatt
Top achievements
Rank 1
Jason Sweatt asked on 17 Nov 2010, 03:03 PM
We have a custom user control that has RadListBoxes.  We populate the RadListboxes with dynamic Templates in the OnIt method.
sample:
override protected void OnInit(EventArgs e)
{
    //
    // CODEGEN: This call is required by the ASP.NET Web Form Designer.
    //
    InitializeComponent();
 
    if (NumberOfColumns == 1)
    {
        ShelfListBox.ItemTemplate = new DefaultListBoxTemplate();
        CartListBox.ItemTemplate = new DefaultListBoxTemplate();
    }
    else if (NumberOfColumns == 2)
    {
        ShelfListBox.ItemTemplate = new TwoColumnListBoxTemplate();
        CartListBox.ItemTemplate = new TwoColumnListBoxTemplate();
    }
    else if (NumberOfColumns == 3)
    {
        ShelfListBox.ItemTemplate = new ThreeColumnListBoxTemplate();
        CartListBox.ItemTemplate = new ThreeColumnListBoxTemplate();
    }
    base.OnInit(e);
}
Right now we have a page that has 6 of our custom control.  
DefaultListBoxTemplate Code:
/// <summary>
/// DefaultListBox ItemTemplate one column
/// </summary>
public class DefaultListBoxTemplate : ITemplate
{
    /// <summary>
    /// Defines the <see cref="T:System.Web.UI.Control"/> object that child controls and templates belong to. These child controls are in turn defined within an inline template.
    /// </summary>
    /// <param name="container">The <see cref="T:System.Web.UI.Control"/> object to contain the instances of controls from the inline template.</param>
    public void InstantiateIn(Control container)
    {
        var label = new Label
                        {
                            ID = "LabelListItem"
                        };
        label.DataBinding += new EventHandler(LabelListItemDataBinding);
        container.Controls.Add(label);
    }
 
    /// <summary>
    /// Handles the DataBinding event of the LabelListItem control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    private static void LabelListItemDataBinding(object sender, EventArgs e)
    {
        var label = (Label)sender;
        var item = (RadListBoxItem)label.BindingContainer;
        var listItemText = DataBinder.Eval(item.DataItem, "Property1") as String;
        label.Text = listItemText;
    }
}

Everything renders correctly on the page, but for some reason in IE7 only, the display of the radlistboxes disappear.  If the page does something on the client side; some of the radlistobxes reappear and some disappear. very strange occurrences in IE7.  Everything works correctly in IE8 or higher, Firefox and chrome.

tried attaching code in zip file...

Version: Telerik.Web.UI 2010.1.309.35

1 Answer, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 19 Nov 2010, 05:58 PM
Hi Jason,

You probably are experiencing this bug - RadListBox has position: relative and such behavior is possible in IE6/7. To fix it, set position: relative to its scrolling container (I can help you pinpoint it if you send me a live URL of the site - open a ticket if you prefer the privacy).

Kind regards,
Kamen Bundev
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
ListBox
Asked by
Jason Sweatt
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Share this question
or