or
RadGrid1.MasterTableView.ExportToExcel()
. I am using MS office 2010.There is a weird thing in excel file. The time format of some rows are AM/PM and others are not (24 hours). In the radgrid, all rows are AM/PM format and are displayed correctly. But why in the exported excel file, some rows are not AM/PM? Thanks.RadGrid1.MasterTableView.ExportToExcel()
. I am using MS office 2010. Before excel is opened, it always popups a warning that says the file format is not correct. It seems that ExportToExcel() creates a .xls file, while excel 2010 default is .xlsx file. I wonder if there is way for ExportToExcel() to generate a .xls file. Thanks. protected
void
RadGrid1_ExportCellFormatting(
object
sender, ExportCellFormattingEventArgs e)
{
GridDataItem item1 = e.Cell.Parent
as
GridDataItem;
if
(e.FormattedColumn.UniqueName ==
"UniqueName"
)
{
TableCell cell = item[
"UniqueName"
];
cell.Style[
"background-color"
] =
"Red"
;
}
}
Dim responseScript As String = String.Format("var secondCombo = $find['{0}'];var firstCombo = $find['{1}'];SecondComboInitialize();", e.Item.FindControl("cboActiveNormDoc").ClientID, e.Item.FindControl("cboNormDocStatus").ClientID)
<
telerik:GridTemplateColumn
HeaderText
=
"Address"
UniqueName
=
"Address"
ItemStyle-Width
=
"20"
>
<
ItemTemplate
>
<
a
href='<%# Eval("Address") %>' title='<%# Eval("Address") %>'><
img
src
=
"images/go.gif"
border
=
"0"
width
=
"33"
></
a
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
Dim
item
As
GridDataItem =
CType
(e.Item, GridDataItem)
If
condition
Then
item(
"Address"
).Controls(0).Visible =
False
End
If
RadGrid1.ExportSettings.IgnorePaging = true; (or false)
RadGrid1.ExportSettings.OpenInNewWindow = false;
RadGrid1.ExportSettings.ExportOnlyData = true;