Completed
Last Updated: 07 Aug 2018 08:25 by Dimitar
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 24 Jul 2018 05:16
Category:
Type: Bug Report
2
FIX. RadListView - ArgumentException when calling BeginEdit after Begin/EndUpdate is used
To reproduce: use the following code snippet and follow the steps from the attached gif file:

      private List<sampleClass> MyList = new List<sampleClass>();

        public RadForm1()
        {
            InitializeComponent();
            MyList.Add(new sampleClass("Test 1"));
            MyList.Add(new sampleClass("Test 2"));
            MyList.Add(new sampleClass("Test 3"));
            MyList.Add(new sampleClass("Test 4"));
            MyList.Add(new sampleClass("Test 5"));
            radListView1.DataSource = MyList; 
        }
        
        private void radButton1_Click(object sender, EventArgs e)
        {
            this.radListView1.BeginEdit();
        }

        private void radButton2_Click(object sender, EventArgs e)
        {
            this.radListView1.EndEdit();
        }

        private void radListView1_ItemValueChanged(object sender, Telerik.WinControls.UI.ListViewItemValueChangedEventArgs e)
        {
            radListView1.BeginUpdate();
            radListView1.CurrentColumn.BestFit();
            radListView1.EndUpdate();
        }
    }

    public class sampleClass
    {
        public string test { get; set; }

        public sampleClass()
        {
        }

        public sampleClass(string Val)
        {
            test = Val;
        }
    }

Workaround: use the ItemEdited event instead of the ItemValueChanged event.
0 comments