Export GridView data to Excel file
Hi,
I have a problem with exporting gridview data into an excel file. in my gridview I have hidden ID column as follow:
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
e.Row.Cells[1].Visible = false;
}
when I try to emport the gridview data to excel i get this error:
Specified argument was out of the range of valid values.
Parameter name: index.
I believe the problem is cause by hidden the id column it works fine, but i need to hide that column. Could anyone kindly help me how to fix this.
many thanks
rao
|