I have a datagridview
and it contain 5 rows, the column name are: XS,S,M,L, and XL.
And the flow is first The user will choose a brand(CHL and XRA), and if the user choose the XRA, the column names will be rename to -,1L,2L,3L,4L.
What the problem here is that every time I get the value from the cell that the column name is renamed, I'm getting this kind of error: Object reference not set to an instance of an object.
This is my sample code for getting the value from the cell:
dvJOBranch.Rows(0).Cells.Item("M").Value.ToString
This code is perfectly working if do not rename the column, but if I rename the column, its having an error.