I having a hard time trying to access hidden columns that been hidden in DataTable which later bind and accessed in DataGridView
In Details : dtResult is a DataTable Example Tried :
dtResult.Columns[i].ColumnMapping = MappingType.Hidden;
OR
dtResult.Columns.RemoveAt(i);
Then Store into DataSource of DataGridView :
dataGridView.DataSource = dtResult;
Accessing Hidden Columns occur error : "Columns 'Active' Cannot be found" :
dataGridView.SelectedRows[0].Cells["active"].Value.ToString()
So Is there are way for DataGridView to get Hidden Columns that been hidden in DataTable before binding it into DataGridView ?
Please help me~ . Thank you
FYI :
I just realized
That DataSource Binding doesn't include Hidden Columns of DataTable.
Means That If DataTable.Column.Count = 10. (2 Hidden)
DataGridView.DataSource = DataTable.
DataGridView.Column.Count == 8.
So lead me to ask. How to Bind Those Hidden Column into the DataGridView From DataTable