hello to all expert
Good Day! i would like to ask some help here coz i wasn't able to configure this out..here's my scenario when the user select on the grid, the selected row only be export to excel but i try to follow the other advice using the radgrid.rebind() but the problem is it show s all the record, but i want only the selected row will be exported to excel..anyway here is my code
what should i do please help..
sample codes is highly appreciated
thanks to all
Good Day! i would like to ask some help here coz i wasn't able to configure this out..here's my scenario when the user select on the grid, the selected row only be export to excel but i try to follow the other advice using the radgrid.rebind() but the problem is it show s all the record, but i want only the selected row will be exported to excel..anyway here is my code
| protected void RadMenu1_ItemClick(object sender, RadMenuEventArgs e) |
| { |
| switch (e.Item.Value)//parentroot |
| { |
| case "2"://Excel |
| RadMenuItem Excel = e.Item; |
| foreach (GridDataItem item in RdGridMainpage.Items) |
| { |
| if (item.Selected == false) |
| { |
| item.Visible = false; |
| } |
| } |
| RdGridMainpage.Rebind(); |
| RdGridMainpage.ExportSettings.ExportOnlyData = true; |
| RdGridMainpage.ExportSettings.IgnorePaging = true; |
| RdGridMainpage.ExportSettings.OpenInNewWindow = true; |
| RdGridMainpage.ExportSettings.FileName = "Request Data"; |
| RdGridMainpage.MasterTableView.ExportToExcel(); |
| break; |
| ===================================================== |
| and my need_Datasource |
| protected void RdGridMainpage_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
| { |
| AppGlobalDeclarations gConn = new AppGlobalDeclarations(); |
| DataSet ds; |
| ds = SqlHelper.ExecuteDataset(gConn.SQLConnection, CommandType.StoredProcedure, "spu_Chs_tblRequestTicket_Mainpage_SelectExport1"); |
| try |
| { |
| this.RdGridMainpage.DataSource = ds; |
| this.RdGridMainpage.Columns[3].Visible = false; |
| this.RdGridMainpage.Columns[4].Visible = true; |
| } |
| catch (Exception ex) |
| { throw ex; } |
| } |
sample codes is highly appreciated
thanks to all