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

RadComboBox - Property to display text when there isn't data to bind

1 Answer 274 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
ok
Top achievements
Rank 1
ok asked on 09 Nov 2010, 03:25 PM
Hi,

I am using telerik:RadComboBox in my application.
I am biding data dynamically to the combobox so if there isn't any data to bind in the combobox and i am clicking on the combobox there is one dark link under the control is displayed.
I don't want this.

So, Is there any property available so i can display a string that "No Data" so user can view that instead of that dark unwanted line.
If property is not available then kindly suggest any method to avoid this.

Please reply asap.

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Nov 2010, 07:23 AM
 Hello,

One suggestion is setting EmptyMessage property to desired text in order to notify user that there is no items in RadComboBox. 

C#:
protected void RadComboBox1_DataBound(object sender, EventArgs e)
    {
            if (RadComboBox1.Items.Count == 0)
            RadComboBox1.EmptyMessage = "Nodata";
    }

ASPX:
<telerik:RadComboBox ID="RadComboBox1" runat="server" Width="186px" DataSourceID="SqlDataSource1"
            DataTextField="new" DataValueField="new" OnDataBound="RadComboBox1_DataBound"
            AllowCustomText="false" onitemdatabound="RadComboBox1_ItemDataBound">
</telerik:RadComboBox>

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