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

ScreenTip for a DropDownList

1 Answer 104 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 01 Feb 2013, 09:35 AM

 

Hello
How can I display the ScreenTip for a DropDownList?
I would be grateful for a hint.
With kind regards

Hello
How can I display the ScreenTip for a DropDownList?
I would be grateful for a hint.
With kind regards
Christian Rudat

1 Answer, 1 is accepted

Sort by
0
Accepted
Plamen
Telerik team
answered on 06 Feb 2013, 01:08 PM
Hi Christian,

Thank you for writing.

In order to show screentips for the items of the drop-down popup, you can subscribe to the ScreenTipNeeded event assign a screentip when it is needed and about to be shown:
public Form1()
{
    InitializeComponent();
 
    this.radDropDownList1.DropDownListElement.Popup.ScreenTipNeeded += new Telerik.WinControls.ScreenTipNeededEventHandler(Popup_ScreenTipNeeded);
}
 
void Popup_ScreenTipNeeded(object sender, Telerik.WinControls.ScreenTipNeededEventArgs e)
{          
    RadOffice2007ScreenTipElement screenTip = new RadOffice2007ScreenTipElement();
    screenTip.CaptionLabel.Text = "Caption " + e.Item.Text;
    screenTip.MainTextLabel.Text = "MainText " + e.Item.Text;
    e.Item.ScreenTip = screenTip;
}

As to the main part of RadDropDownList, it consist of several smaller parts (ArrowButtonDropDownListElement and TextBoxItem) that need to have screentips assigned to them:
RadOffice2007ScreenTipElement arrowButtonScreenTip = new RadOffice2007ScreenTipElement();
arrowButtonScreenTip.CaptionLabel.Text = "ArrowButton element";
arrowButtonScreenTip.MainTextLabel.Text = "ScreenTip";
this.radDropDownList1.DropDownListElement.ArrowButton.ScreenTip = arrowButtonScreenTip;
 
RadOffice2007ScreenTipElement dropDownListElementScreenTip = new RadOffice2007ScreenTipElement();
dropDownListElementScreenTip.CaptionLabel.Text = "DropDownListElement element";
dropDownListElementScreenTip.MainTextLabel.Text = "ScreenTip";
this.radDropDownList1.DropDownListElement.ScreenTip = dropDownListElementScreenTip;
 
RadOffice2007ScreenTipElement editableElementScreenTip = new RadOffice2007ScreenTipElement();
editableElementScreenTip.CaptionLabel.Text = "TextBoxItem element";
editableElementScreenTip.MainTextLabel.Text = "ScreenTip";
this.radDropDownList1.DropDownListElement.EditableElement.TextBox.TextBoxItem.ScreenTip = editableElementScreenTip;

Find attached a sample project which demonstrates this functionality.

I hope this helps.

Regards,
Plamen
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
DropDownList
Asked by
Christian
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or