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

Combo Box Alternate Text Display

1 Answer 96 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ajay
Top achievements
Rank 1
Ajay asked on 24 Mar 2009, 10:58 AM
Hello,

When there is no item selected then the dropdown should display the alternate text i.e."Select Name" (or any other). On clicking the dropdown that text should disappear or appears when the item is not selected in Light color with italic font style.

Thank you,

Ajay

1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 25 Mar 2009, 12:05 PM
Hello Ajay,

Thank you for writing and your suggestion. We have added this feature to our TODO list and will consider implementing it in one of our future releases.

Currently you could easily accomplish this by subscribing to the Enter and Leave events and changing the Text and Font properties as needed. Please note that all properties are being accessed through the ComboBoxElement property.

If you need the functionality feel free to use the code below:

public Form1()  
{  
    InitializeComponent();  
    radComboBox1_Leave(nullnull);  
}  
 
private void radComboBox1_Enter(object sender, EventArgs e)  
{  
    this.radComboBox1.ComboBoxElement.Text = "";  
    this.radComboBox1.ComboBoxElement.ResetValue(RadComboBoxElement.ForeColorProperty);  
    this.radComboBox1.ComboBoxElement.ResetValue(RadComboBoxElement.FontProperty);  
}  
 
private void radComboBox1_Leave(object sender, EventArgs e)  
{  
    this.radComboBox1.ComboBoxElement.Text = "Choose option";  
    this.radComboBox1.ComboBoxElement.Font = new Font("Arial", 8.5f, FontStyle.Italic);  
    this.radComboBox1.ComboBoxElement.ForeColor = Color.LightGray;  

Please write back if you have other suggestions or questions.

Greetings,
Victor
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
Ajay
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or