In some cases the dropdown list will be having large text. And the size of dropdown list is small. In such cases the item won’t be visible to the end user. One option is to expand the dropdown list. But if the size of text is large then it won’t look good in UI. One workaround is to place the item as tooltip. For achieving this you can use the following code.
DropDownList1.Items.Add("1");The title attribute will just add the provided value as the tooltip.
DropDownList1.Items[0].Attributes.Add("Title", "Some1");
DropDownList1.Items.Add("2");
DropDownList1.Items[1].Attributes.Add("Title", "Some2");
DropDownList1.Items.Add("3");
DropDownList1.Items[2].Attributes.Add("Title", "Some3");
Hope this helps.
No comments:
Post a Comment