hi thr,i can help u this extent that you can remove the data waht eveer in column but even i am unable to completely remove column.try this or if you got any idea please forward to me also.but this is for the fields like buttonfields or linkfields.
private void PrepareGridViewForExport(Control gv)
{
Button lb = new Button();
Literal l = new Literal();
string name = String.Empty;
for (int i = 0; i < gv.Controls.Count; i++)
{
if (gv.Controls[i].GetType() == typeof(Button))
{
l.Text = (gv.Controls[i] as Button).Text;
gv.Controls.Remove(gv.Controls[i]);
}
else
if (gv.Controls[i].HasControls())
{
PrepareGridViewForExport(gv.Controls[i]);
}
}
I am trying to export a datagrid to Excel. Via web help, I'm 90% there. My
only problem is that I would like to remove one column from the export. I've been successful at removing the data portion of the column, but I can't get rid of the heading. Any help would be appreciated.