Completed
Last Updated: 04 May 2015 10:00 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 09 Apr 2015 08:28
Category:
Type: Bug Report
1
FIX. RadCheckedListBox - when the AllowArbitraryItemWidth property is set to true and the items contain a long string, the horizontal scrollbar does not take into consideration the checkbox width
To reproduce:

public Form1()
{
    InitializeComponent();

    List<string> items = new List<string>();
    StringBuilder sb;
    for (int i = 0; i < 10; i++)
    {
        sb = new StringBuilder();
        for (int j = 0; j < 5; j++)
        {
            sb.Append(i + "." + j + ".some text");
        }
        sb.Append(" END");
        items.Add(sb.ToString());
    }

    this.radCheckedListBox1.AllowArbitraryItemWidth = true;
    
    this.radCheckedListBox1.DataSource = items;          
}

Workaround: measure the desired size for the longest string in the DataSource collection, e.g. by using TextRenderer.MeasureText method, and set the RadCheckedListBox.ItemSize property considering the check-box size as well.
0 comments