3 Answers, 1 is accepted
0
Hello Golnar,
Thank you for writing.
It is suitable to use the VisualListItemFormatting event in order to customize the dropdown items and change the font: http://docs.telerik.com/devtools/winforms/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/formatting-items
As to the focus color, you can subscribe to the RadDropDownList.GotFocus event and set the desired ForeColor to the DropDownListElement.EditableElement.TextBox.TextBoxItem. It is necessary to reset the color in the RadDropDownList.LostFocus event:
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Telerik
Thank you for writing.
It is suitable to use the VisualListItemFormatting event in order to customize the dropdown items and change the font: http://docs.telerik.com/devtools/winforms/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/formatting-items
As to the focus color, you can subscribe to the RadDropDownList.GotFocus event and set the desired ForeColor to the DropDownListElement.EditableElement.TextBox.TextBoxItem. It is necessary to reset the color in the RadDropDownList.LostFocus event:
public
Form1()
{
InitializeComponent();
this
.radDropDownList1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
this
.radDropDownList1.GotFocus += radDropDownList1_GotFocus;
this
.radDropDownList1.LostFocus += radDropDownList1_LostFocus;
}
private
void
radDropDownList1_LostFocus(
object
sender, EventArgs e)
{
this
.radDropDownList1.DropDownListElement.EditableElement.TextBox.TextBoxItem.ForeColor = Color.Black;
}
private
void
radDropDownList1_GotFocus(
object
sender, EventArgs e)
{
this
.radDropDownList1.DropDownListElement.EditableElement.TextBox.TextBoxItem.ForeColor = Color.Red;
}
Font f =
new
Font(
"Arial"
,10f, FontStyle.Italic);
private
void
radDropDownList1_VisualListItemFormatting(
object
sender, Telerik.WinControls.UI.VisualItemFormattingEventArgs args)
{
args.VisualItem.Font = f;
}
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
golnar
Top achievements
Rank 1
answered on 18 Apr 2016, 09:49 AM
I did what you said to change RadDropDownList focus color, but it had no effect. My RadDropDownList focus color is not changed.
0
Accepted
Hello Golnar,
Thank you for writing back.
The provided solution is applicable to the RadDropDownStyle.DropDownList. The RadDropDownList.DropDownStyle property determines if the text area at the top of the control can be edited. A setting of DropDown allows editing and TextBox hosted in the editable part. Setting the DropDownListElement.EditableElement.ForeColor will affect the color in both modes. I have attached my sample project for your reference.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik
Thank you for writing back.
The provided solution is applicable to the RadDropDownStyle.DropDownList. The RadDropDownList.DropDownStyle property determines if the text area at the top of the control can be edited. A setting of DropDown allows editing and TextBox hosted in the editable part. Setting the DropDownListElement.EditableElement.ForeColor will affect the color in both modes. I have attached my sample project for your reference.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.