Unplanned
Last Updated: 30 Dec 2022 08:52 by ADMIN
Radek
Created on: 30 Dec 2022 07:49
Category: FilterView
Type: Bug Report
0
RadFilterView: Crash when incrementing the spin editor for a field only with null values

Use the following code and press the arrow of the spin editor for the Price category in RadFilterView:

            DataTable dt = new DataTable();
            dt.Columns.Add("Id", typeof(int));
            dt.Columns.Add("Name", typeof(string));
            dt.Columns.Add("Price", typeof(decimal));
            for (int i = 0; i < 10; i++)
            {
                dt.Rows.Add(i,"Item"+i, null);
            }

            this.radGridView1.DataSource = dt;
            this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
            this.radFilterView1.AssociatedControl = this.radGridView1;

The following error occurs:

1 comment
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 30 Dec 2022 08:52

Hi, Radek,

Thank you for bringing this to our attention. Currently, the possible solution that I can suggest is to initialize the spin editors with values:

            this.radFilterView1.CategoryCreated += RadFilterView1_CategoryCreated;
            this.radFilterView1.AssociatedControl = this.radGridView1;

        private void RadFilterView1_CategoryCreated(object sender, FilterViewCategoryCreatedEventArgs e)
        {
            FilterViewNumericCategoryElement cat = e.Category as FilterViewNumericCategoryElement;
            if (cat!=null && cat.PropertyName=="Price")
            {
                
                cat.MinValueSpinEditor.NullableValue = 0;
                cat.MaxValueSpinEditor.NullableValue = 1; 

            }
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.