hii all,
i've a datagrid which i'm exporting to excel.. but probelm is that i don't want all the rows in datagrid to be exported to excel ,only those rows who are selected by checkbox shud go to excel sheet.
plz tell me the solution if any1 knows...
Thanks & Regards
Anant Vijay
anant vijayPosted Feb 29, 2008, 5:13 AM
hii,
i've already done that... 1 thing i wanna tell u that.. we dont need to do like that...jus write this line..
for
(int i = 0; i < DataGrid1.Items.Count; i++){
//CheckBox box = GridView1.Rows[i].FindControl("CheckBox1") as CheckBox;CheckBox chk=DataGrid1.Items[i].FindControl("check1")
as CheckBox; //CheckBox chk=(CheckBox)di.FindControl("check1"); if (!chk.Checked){
//GridView1.Rows[i].Attributes.Add("style", "display:none");DataGrid1.Items[i].Attributes.Add("style","display:none");
}
}
in ur export to excel function... it really works..
regards
anant vijay
dilipv vishwakarmaPosted Feb 29, 2008, 4:46 AM
You need to Create the tmp table in your database and then just add this table for selected item, and then make one buffer grid and bind this new instance grid with tmp table. and pass it into your download procedure.
When conclude it, the process are like this.
There is one good article based on your exact requirement. But it is in VB.net, just you need to convert it in to c#. Checkout the given link as follows.
http://forums.asp.net/t/1193290.aspx
Hope this will help you.
Thanks & Regards
Dilipv
Programmer
SharePoint Consulting