Click here to Skip to main content
15,877,145 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,I need to write gridview's datasource to xml file but there is image column on gridview so I want to delete the column but it also effects to gridview. How can I copy the data ?

DataTable dt = new DataTable();
dt = (DataTable)datagrid.DataSource;
dt.Columns.Remove("ImageColumn");
dt.WriteXml(saveFileDialog1.FileName);
dt.Dispose();
Posted
Updated 3-Feb-12 5:36am
v2

1 solution

This can be done by binding datatable without removing image column
and hide image column in gridview. this will solve your problem.

Thanks
SP
 
Share this answer
 
Comments
Kutayy 3-Feb-12 12:48pm    
setting visible to false is not solving my problem I want to user see photos while saving the data.this is not a good way to solve this problem i think.are you sure there is not another way ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900