Tuesday, 6 August 2013

How to hide column in data table

How to hide column in data table

I have Data Table which I filled with SQL Query.Then I fiiled Grid View
with Data Table.
DataTable table = new DataTable();
table.Load(reader);
gvAktivne.DataSource = table;
gvAktivne.DataBind();
This works fine.But now I want to hide first column.When i add this:
gvAktivne.Columns[0].Visible = false;
I have problem with exception IndexOutOfRange. Does anybody have an idea
how to fix this?

No comments:

Post a Comment