Issue with grid editing

I have databound listgrid. I am using setTestData to set the contents of the grid.
This grid has couple of dropdowns one using DatasourceEnumfileld and one using a dynamic Select using selectitem and FilterCriteriaFunction.

The grid and the dropdowns work fine initially.
However if I change the contents (rows) for the grid using setTestData() on my datasource matchcolDataDs
[and i have to followthat with

        matchConfigGrid.setDataSource(matchcolDataDs);
        matchConfigGrid.fetchData();
        
        matchConfigGrid.setFields(fieldarray) again]

The dropdown stop working. They donot show any value.
The text edit columns accept input, but they dont retain them after i move to the next row.

Please help me, as I said the grid works perfectly fine the first time, till I change the contents, which I need to do based on some event.

You should be calling setFields() before fetchData as field changes (like remvoning the sort field) can affect the fetch.

Other than that, it’s useless to ask a question like this with so little detail, and no code.