To reproduce:
ThemeResolutionService.ApplicationThemeName = "Windows11"
Dim UserGroup As New DescriptionTextListDataItem
With UserGroup
.Text = "Admins"
'.Font = New Font("Microsoft Sans Serif", 9.75, FontStyle.Bold)
.DescriptionText = "System Administrations Group"
End With
Me.RadListControl1.Items.Add(UserGroup)
Me.RadListControl1.ItemHeight = 50
Actual result:
Expected result:
Please use the following code snippet and see the gif file illustrating the incorrect scrollbars position after scrolling to the last item and selecting it:
public RadForm1()
{
InitializeComponent();
this.radListControl1.ItemHeight = 30;
}
private void radButton1_Click(object sender, EventArgs e)
{
this.radListControl1.ScrollToItem(this.radListControl1.Items.First);
this.radListControl1.SelectedItem = this.radListControl1.Items.First;
}
private void radButton2_Click(object sender, EventArgs e)
{
this.radListControl1.ScrollToItem(this.radListControl1.Items.Last);
this.radListControl1.SelectedItem = this.radListControl1.Items.Last;
}
private void RadForm1_Load(object sender, EventArgs e)
{
List<Rivi> tmpList = new List<Rivi>();
tmpList.Add(new Rivi() { Key = 1, Code = "1st" });
tmpList.Add(new Rivi() { Key = 2, Code = "2nd" });
tmpList.Add(new Rivi() { Key = 3, Code = "3rd" });
tmpList.Add(new Rivi() { Key = 4, Code = "4th" });
tmpList.Add(new Rivi() { Key = 5, Code = "5th" });
this.radListControl1.ValueMember = "Key";
this.radListControl1.DisplayMember = "Code";
this.radListControl1.DataSource = tmpList;
}
public class Rivi
{
public int Key { get; set; }
public string Code { get; set; }
}
Workaround:
this.radListControl1.ScrollToItem(this.radListControl1.Items.Last);
this.radListControl1.ListElement.InvalidateMeasure(true);
this.radListControl1.ListElement.UpdateLayout();
this.radListControl1.SelectedItem = this.radListControl1.Items.Last;
Please use the following code snippet. When you select all items, only half of the items have the selected color applied:
public RadForm1()
{
InitializeComponent();
for (int i = 0; i < 20; i++)
{
this.radListControl1.Items.Add("Item" + i);
}
this.radListControl1.EnableAlternatingItemColor = true;
this.radListControl1.SelectionMode = SelectionMode.MultiSimple;
}
private void radButton1_Click(object sender, EventArgs e)
{
this.radListControl1.SelectAll();
}
Workaround:
this.radListControl1.SelectAll();
DefaultListControlStackContainer viewElement = this.radListControl1.ListElement.ViewElement as DefaultListControlStackContainer;
if (viewElement != null)
{
viewElement.ForceVisualStateUpdate();
}
}