I have DataTable
which I filled using an SQL Query. Then I filled the GridView
with the DataTable
.
DataTable table = new DataTable();
table.Load(reader);
gvAktivne.DataSource = table;
gvAktivne.DataBind();
This works fine but now I want to hide the first column. When I add this:
gvAktivne.Columns[0].Visible = false;
I get an IndexOutOfRange
exception.
Does anybody have an idea how to fix this?