Unplanned
Last Updated: 14 Nov 2022 20:41 by ADMIN
Alessandro
Created on: 14 Nov 2022 20:28
Category: GridView
Type: Feature Request
1
GridView: Clear value of ComboBoxColumn cell when the editor contains item with empty string

In this particular scenario, the RadDropDownListEditor element inside the RadComboBoxColumn cell contains an empty string item. So when we try to clear the value of the cell and leave it empty, the internal logic will return the last selected valid value. The following code demonstrate a simple example:

DataTable dt = new DataTable();
dt.Columns.Add("id", typeof(int));
dt.Columns.Add("codice", typeof(string));
dt.Columns.Add("nome", typeof(string));

dt.Rows.Add(0, "", "");
dt.Rows.Add(1, "I622", "Seravezza");
dt.Rows.Add(2, "G628", "Pietrasanta");
dt.Rows.Add(3, "L833", "Viareggio");

The first row in the DataTable which the RadGridView contains an empty value. If for example, the second row is selected and we use Backspace/Delete to clear the text and move to another cell. The selected item won't be changed. The cell value won't be cleared. To workaround this we could avoid using empty strings. We could use space or some other symbol to allow the user to clear the value from the drop-down popup.

dt.Rows.Add(0, "", "-");
OR
dt.Rows.Add(0, "", " ");

1 comment
ADMIN
Dinko | Tech Support Engineer
Posted on: 14 Nov 2022 20:41

Hi Alessandro,

Thank you for bringing this to our attention. We will do our best to improve the RadComboBoxColumn in this scenario.

Regards,
Dinko | Tech Support Engineer
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/.