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

Rad Combo Box

1 Answer 88 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ritzie
Top achievements
Rank 1
Ritzie asked on 18 Feb 2009, 11:25 AM


Hello All,

                I am using a auto complete rad combo box to display the data .I want that the combo box should show "SELECT" as the default value but I am not able to do with Rad Combo Box.Please anyone can help me with this.The Rad Combo Box is not showing anything,it is blank.

As in simple combo box we can give the selected value but in this Rad Combo Box there is no such property as Selected Value.
I am stuck up with this problem.



Thank You in Advance
Regards,
Ritzie

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 Feb 2009, 12:14 PM
Hi Ritzie,

I hope you want to display message to select an item in RadComboBox on loading. One option is by setting the EmptyMessage property. The EmptyMessage property can be used when the AllowCustomText property is set to True.

Here's ASPX:
<telerik:RadComboBox ID="RadComboBox2" AllowCustomText="true" runat="server" MarkFirstMatch="True" EmptyMessage="SELECT">  
    <Items> 
        <telerik:RadComboBoxItem runat="server" Text="Apples" /> 
        <telerik:RadComboBoxItem runat="server" Text="Plums" /> 
        <telerik:RadComboBoxItem runat="server" Text="Grapes" /> 
    </Items> 
</telerik:RadComboBox>  

Also you can set the selecteditem by using SelectedValue property from server side. See the example.
CS:
protected void Page_Load(object sender, EventArgs e)  
{  
    RadComboBox3.SelectedValue = "0";  

ASPX:
<telerik:RadComboBox ID="RadComboBox3" runat="server" MarkFirstMatch="True" >     
    <Items>    
        <telerik:RadComboBoxItem runat="server" Text="SELECT" Value="0" /> 
        <telerik:RadComboBoxItem runat="server" Text="Apples" Value="1" />    
        <telerik:RadComboBoxItem runat="server" Text="Plums" Value="2" />    
        <telerik:RadComboBoxItem runat="server" Text="Grapes" Value="3" />    
    </Items>    
</telerik:RadComboBox> 

Thanks,
Princy.
Tags
ComboBox
Asked by
Ritzie
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or