Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > ComboBox and ListBox (obsolete as of Q2 2010) > Combo Box Alternate Text Display

Not answered Combo Box Alternate Text Display

Feed from this thread
  • Ajay avatar

    Posted on Mar 24, 2009 (permalink)

    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

    Reply

  • Victor Victor admin's avatar

    Posted on Mar 25, 2009 (permalink)

    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.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > ComboBox and ListBox (obsolete as of Q2 2010) > Combo Box Alternate Text Display
Related resources for "Combo Box Alternate Text Display"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]