This is a migrated thread and some comments may be shown as answers.

Programmatic adding items to radCheckedDropDownList throws error

1 Answer 42 Views
CheckedDropDownList
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 11 Sep 2018, 05:32 PM

Hi all

I'm working with Visual Studio 2017, .NET 4.6.1, Telerik UI for WinForms 2018.2.621

This is the code:

 

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Telerik.WinControls.UI;

namespace TelerikTest
{
    public partial class Form1 : Form
    {
        private List<string> list = new List<string>() { "one", "two", "three" };
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            radCheckedDropDownList1.Items.Clear();

            foreach (string item in list)
            {
                radCheckedDropDownList1.Items.Add(new RadCheckedListDataItem(item, false));
            }
        }
    }
}

If I fill the radCheckedDropDownList after having selected an item by click (SelectByClick.png) all is fine.

If I fill the radCheckedDropDownList after having selected an item using autocomplete (SelectByAutoComplete.png), I get a NullReferenceException (NullReferenceException.png).

 

Could someone please tell me, what I'm doing wrong?

 

Thanks in advance

Daniel

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 12 Sep 2018, 11:28 AM
Hello, Daniel,          

Your question has already been answered in the support thread you have opened on the same topic. Please, see our answer there for more information. However, I am posting the answer here as well in order the community to benefit from it. I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

We kindly ask you to use just one thread for a specific problem to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two or more tickets instead of one. Moreover, threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.

Thank you for your understanding.

Regards,
Dess
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
CheckedDropDownList
Asked by
Daniel
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or