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

Default not showing up onload

3 Answers 34 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 24 Jul 2008, 06:59 PM
I have a combobox and have a default item which is listed at the top but I can only see it if I click on the comboBox.  How do I get it so that the ComboBox sets the default item on page load.

The items are listed from the database and the insert item, but it looks empty unless I click on it.
RadComboBox1.DataBind();  
RadComboBox1.Items.Insert(0, new RadComboBoxItem("- Select an Item -")); 

3 Answers, 1 is accepted

Sort by
0
Accepted
Rosi
Telerik team
answered on 25 Jul 2008, 07:41 AM
Hi George,

I suggest you set the Selected property of this item to true:

RadComboBox1.DataBind();     
RadComboBox1.Items.Insert(0, new RadComboBoxItem("- Select an Item -"));    
RadComboBox1.Items[0].Selected = true;  
 

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mike
Top achievements
Rank 1
answered on 25 Jul 2008, 01:31 PM
It seems that the issue is with the radformdecorator tag.  As soon as I removed it the selections started working. 
0
Rosi
Telerik team
answered on 28 Jul 2008, 06:46 AM
Hi George,

There is a problem related to RadComboBox and RadFormDecorator in version 2008.1.619. This bug is fixed in version 2008.2.723 released yesterday.

The solution of this problem will be included in the Q2 release next week.

Meanwhile, you can use the following workaround and paste this code to your aspx page:
 <script> 
        function pageLoad()  
        {  
           var inputs = document.getElementsByTagName("INPUT");  
           for (var i=0; i < inputs.length; i++)  
           {  
                inputs[i].style.zoom = "1";                  
           }         
        }  
  </script>       


Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Mike
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Mike
Top achievements
Rank 1
Share this question
or