// Check that nummber of elements in Enum for the gridcells is the same as actuall number of cells in the gridview.
if (Enum.GetValues(typeof(GridCells)).Length != GridViewData.Columns.Count)
{
throw new Exception("Number of elements in enum GridCells differs from number of cells in GridViewData");
}