Tooltip is not showing in RadDropDownList when VisualItem is enabled as false

2 Answers 22 Views
DropDownList
Raj
Top achievements
Rank 1
Iron
Iron
Raj asked on 04 Jun 2024, 10:01 AM

Hello Team,

 I try to set tooltip for combobox lineitem which is disabled , it is not showing tooltip, Is there any way to show tooltip while it disabled ? could you please help on this ASAP?

Please refer below code snippet and attached screenshot. 

private void cmbPlugtype_VisualListItemFormatting(object sender, VisualItemFormattingEventArgs args)
 {
if (cmbPlugtype.DropDownListElement.TextBox.Fill.BackColor != Color.Cyan)
{
    args.VisualItem.ToolTipText = args.VisualItem.Data.DisplayValue.ToString();
}
else
{
    args.VisualItem.Enabled = false;

   args.VisualItem.ToolTipText = "It is Disabled".

}

}

Thanks

Rajkannan

Raj
Top achievements
Rank 1
Iron
Iron
commented on 06 Jun 2024, 09:54 AM

Hello Team,

Any update on this???

 

Thanks

Rajkannan

2 Answers, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 06 Jun 2024, 12:59 PM

Hello, Raj,

Tooltips cannot be displayed for disabled elements by design. The possible solution that I can suggest is to set the Enabled=true for all visual items, and set gray ForeColor to the items so that they look like as they are disabled. 

I prepared a sample code snippet to demonstrate this approach:

 private void RadDropDownList1_VisualListItemFormatting(object sender, VisualItemFormattingEventArgs args)
 {
     if (args.VisualItem.Text != "Item 0")
     {
         args.VisualItem.Enabled = true;
         args.VisualItem.ForeColor = Color.Gray;
         args.VisualItem.ToolTipText = "It is Disabled";
     }
 }

Off topic, I would like to note that threads are handled according to license and time of posting, so if you expect a faster reply by a support representative, you can submit a support ticket, which would be handled before a forum thread.

I hope this helps. If you have any other questions, please let me know.

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Raj
Top achievements
Rank 1
Iron
Iron
commented on 07 Jun 2024, 06:37 AM

Hello Nadya,

Thanks for your response.

can you please provide , How to make "args.VisualItem.Selectable" as false?

 

Thanks

Rajkannan

0
Raj
Top achievements
Rank 1
Iron
Iron
answered on 07 Jun 2024, 06:37 AM

Hello Nadya,

Thanks for your response.

can you please provide , How to make "args.VisualItem.Selectable" as false?

 

Thanks

Rajkannan

Nadya | Tech Support Engineer
Telerik team
commented on 10 Jun 2024, 07:20 PM

Hello, Raj,

It is not possible to set args.VisualItem.Selectable to false. Selectable property can be only get, not set. In my sample I mimic the gray look of the items, so they just look as disabled. To disable an item it requires setting Enabled=false which doesn't show a tooltip. 

You can check the following thread from StackOverflow which shows other ideas: c# - Displaying tooltip over a disabled control - Stack Overflow

Please let me know if you have any other questions.

Tags
DropDownList
Asked by
Raj
Top achievements
Rank 1
Iron
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Raj
Top achievements
Rank 1
Iron
Iron
Share this question
or