Completed
Last Updated: 13 Oct 2015 12:47 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 12 Oct 2015 14:59
Category:
Type: Bug Report
1
FIX. RadListControl - NullReferenceException when pressing Home/End key in an empty RadListControl
To reproduce:

1. Create a new WinForms project
2. Drag a RadListControl on the form
3.Start the application/project
3. Focus the Control and press Pos 1 / Home or End. >> The Application crashes due to a Telerik Control internal NullReference Exception

Workaround: 

public class CustomListControl : RadListControl
{
    public override string ThemeClassName
    {
        get
        {
            return typeof(RadListControl).FullName;  
        }
    }

    protected override void OnKeyDown(KeyEventArgs e)
    {
        if ((e.KeyCode == Keys.Home || e.KeyCode == Keys.End) && this.Items.Count == 0)
        {
            return;
        }
        base.OnKeyDown(e);
    }
}

0 comments