Hello,
I've included an Export to excel feature for my grid, i'm facing few issues
1. I'm unable to add borders for the excel sheet. is it that i can add border for only one edge of the row/column?
I've added the above code inside "RadGrd1_ExcelMLExportStylesCreated", but the excel generated has boder only for the last position type (i.e. border.PositionType = PositionType.Bottom;) the rest are overwritten.
2. I'm trying to dynamically generate the name of the excel, on clik of the export to excel button a file download window is displayed with the name which i've specified and click of "Save" this works fine. But on click of "Open" the excel files has different name (junk values). Also how do we change the sheet names.
I've included an Export to excel feature for my grid, i'm facing few issues
1. I'm unable to add borders for the excel sheet. is it that i can add border for only one edge of the row/column?
| BorderStyles border = new BorderStyles(); |
| border.Color = Color.Black; |
| border.Weight = 1; |
| border.LineStyle = LineStyle.Continuous; |
| border.PositionType = PositionType.Top; |
| border.PositionType = PositionType.Right; |
| border.PositionType = PositionType.Left; |
| border.PositionType = PositionType.Bottom; |
| style.Borders.Add(border); |
2. I'm trying to dynamically generate the name of the excel, on clik of the export to excel button a file download window is displayed with the name which i've specified and click of "Save" this works fine. But on click of "Open" the excel files has different name (junk values). Also how do we change the sheet names.
| string date = System.DateTime.Today.Date.ToString(); |
| string filename = "Grid Details_" + date; |
| RadGrd1.ExportSettings.FileName = filename; |
| RadGrd1.MasterTableView.ExportToExcel(); |
3. The Excel which is generated does not get aligned (i.e. Some texts are getting hidden by the next column), how do i wrap and unwrap the column text through code.
Thanks in advance.
Kavi