When the user hits enter the search is performed and the datasource is updated with the results in a WebDataGrid which do appear on the page correctly.
By default I have made it so all the results are selected in the grid and when the user clicks a process button, I read the grid's columns and do stuff to the data. The column objects aren't present when I call :
this method returns this: Invalid column name: Object reference not set to an instance of an object.
If the user interacts with the grid by selecting a single record and re-selecting all of them and clicking the same process button on the page, then all the objects for the columns are instantiated and accessible in code-behind.
Adding a grid.DataBind() immediately before accessing the column values has no effect.
Sorry about this but I figured out that having multiple selected rows in the grid was the cause of the problem. Instead of using GetGridSelectedColValue ti get the value I needed I switched to using grdRecherche.Rows[i].Items.FindItemByKey
I am glad that you have managed to resolve your issue ! Rows[i].Items.FindItemByKey is the way to get a cell by its column key, so you can compare this code with the code inside GetGridSelectedColValue to determine if there is a mistake in it.
You can still reach out to us for any assistance you may need.