Auto-complete items overlap in the VisualStudio2022 theme:
The currently applied theme is VisualStudio2022Light. The button its move down due to the scaling mechanism.
Add option to enter new value that is independent from the data source or items.
1. PropertyGridTextBoxEditor becomes smaller height.
2. DropDownListEditorElement also has a small height and popup appear with a vertical scrollbar.
Setting the DataSource in the SelectedIndexChanged event will trigger the event again. Thus leading to StackOverflowException.
A possible workaround will be to unsubscribe from the event when changing the DataSource property or raise a flag which can be checked in the event handler.
StackOverflowException is thrown when setting SelectedValue in the SelectedIndexChanged event.
To workaround this we can unsubscribe from the event before setting the SelectedValue property and then subscribe again. Another approach is to change the SelectedIndex property in the SelectedIndexChanged or SelectedValue in the SelectedValueChanged event.
Use the following code snippet and click the button to delete the first item from the BindingList:
BindingList<DoctorTest> list = new BindingList<DoctorTest>();
public RadForm1()
{
InitializeComponent();
for (int i = 0; i < 5; i++)
{
list.Add(new DoctorTest(i,"Item"+i));
}
this.radDropDownList1.DisplayMember = "Name";
this.radDropDownList1.ValueMember = "Id";
this.radDropDownList1.DataSource = list;
this.radDropDownList1.SelectedIndex = 4;
this.radDropDownList1.SelectedValueChanged+=radDropDownList1_SelectedValueChanged;
}
private void radDropDownList1_SelectedValueChanged(object sender, EventArgs e)
{
RadMessageBox.Show(this.radDropDownList1.SelectedValue +" ---");
}
public class DoctorTest
{
public int Id { get; set; }
public string Name { get; set; }
public DoctorTest(int id, string name)
{
this.Id = id;
this.Name = name;
}
}
private void radButton1_Click(object sender, EventArgs e)
{
list.RemoveAt(0);
}
Run the attached project and minimize the form. Then, restore to its normal state:
Initial state:
After minimizing the form and restoring to its normal state, the arrow for RadDropDownList seems clipped:
RadDropDownList gets focused when the DpiScaleChanged is triggered.
Run the attached sample project. When the form is moved from monitor A (100% DPI) to monitor B (150% DPI), every RadDropDownList gets the focus which leads to scrolling the container back to the top.
Run the attached project and open the drop down. When the mouse wheel is used, the items in the drop down are expected to scroll.
Expected: items are scrolled.
Actual: nothing happens
Note: It works in .NET 4.8, but not in .NET 6
It worked in R2 2022 SP1.
Use the following code snippet and refer to the attached gif file:
private RadDropDownList Drop { get; set; }
public RadForm1()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.Drop = new RadDropDownList();
this.Drop.AutoSize = true;
this.Drop.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList; //So users can't write.
this.Drop.Font = new Font("Segoe UI", 11.25f, FontStyle.Regular, GraphicsUnit.Point);
RadListDataItem item = new RadListDataItem();
item.Value = string.Empty;
item.Text = string.Empty;
this.Drop.Items.Add(item);
RadListDataItem item2 = new RadListDataItem();
item2.Value = "Hello";
item2.Text = "Hello";
this.Drop.Items.Add(item2);
this.Controls.Add(this.Drop);
this.Drop.SizeChanged += Drop_SizeChanged;
}
private void Drop_SizeChanged(object sender, EventArgs e)
{
this.Text = this.Drop.Size.ToString();
}
}
Using this font is OK:
Font("Calibri", 24, FontStyle.Regular, GraphicsUnit.Pixel)
But using this font is not OK, the Unit is not respected:
Font("Calibri", 24, FontStyle.Italic | FontStyle.Bold, GraphicsUnit.Pixel)
The control also is increased in height.
Please run the attached sample project and you will notice that the arrow button is missing. If you comment applying the Office2019Light theme the arrow is shown.
Fluent theme:
Workaround:
Me.RadDropDownList1.DropDownListElement.ArrowButtonMinWidth = 20