Search code examples
vb.netdatagridviewdevexpress

Dev Express DataGrid cell cannot change a value in VB.NET


The first 3 columns of my datagrid in Dev Express are loaded from a datasource. I have 2 more columns: AccountID (ID Akun) and GridColumn1, created via datagrid designer and for some reason I can't change their values.

When I type a value in a cell for AccountID (ID Akun) or GridColumn1 columns and then move to another cell, the entered value into the previous cell disappears. Also when I try to create a new column again then always have the same result that the column cell gets empty.

How do I create a column? I simply use the designer page and then click on Add Column icon.

Below is the screenshot. enter image description here

What could possibly go wrong and provoke the empty cell behaviour?

Note that I have no any changeValue or click cell event configured.


Solution

  • So, I found the solution.

    The problem was in the datasource class. I have a class named "SalaryType" that does not have the "AccountID" property, so when loading the datasource from "SalaryType" class, it is not able to edit a column which does not come from the "SalaryType" class.

    To fix it, I added the "AccountID" property and defined get & set methods to access and update its value. And the cell editing works now.