or
//formating data grid
protected
void
RadGrid10_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
{
GridDataItem dataItem = (GridDataItem)e.Item;
dataItem.BackColor = System.Drawing.Color.FromName(dataItem[
"M"
].Text); ;
dataItem.Font.Size = Convert.ToInt16(dataItem[
"L"
].Text);
dataItem.Font.Bold = dataItem[
"N"
].Text ==
"true"
?
true
:
false
;
dataItem.Font.Italic =
true
;
dataItem.BorderStyle = BorderStyle.Solid;
dataItem.BorderWidth = Unit.Pixel(1);
dataItem.BorderColor = System.Drawing.Color.Black;
}
}
//export to pdf
protected
void
ImageButton1_Click(
object
sender, ImageClickEventArgs e)
{
if
((String)Session[
"partnerHP"
] !=
"-9999"
)
{
foreach
(GridDataItem item
in
RadGrid10.Items)
{
item.Style[
"background-color"
] = item[
"M"
].Text;
item.Style[
"font-family"
] =
"Arial Unicode MS"
;
}
RadGrid10.ExportSettings.Pdf.Title = hf.Value.ToString();
RadGrid10.ExportSettings.FileName = hf.Value;
GridHeaderItem headerItem = RadGrid10.MasterTableView.GetItems(GridItemType.Header)[0]
as
GridHeaderItem;
headerItem.Visible =
false
;
RadGrid10.MasterTableView.ExportToPdf();
}
else
{
RadWindowManager1.RadAlert(
"Za izpis v pdf morajo biti prikazane podrobnosti!"
, 400, 150,
null
,
null
);
}
}
...and I don't know which property/properties to modify to get the desired change?
Cheers in advance,
Gordopolis
Grid.ExportSettings.IgnorePaging =
true
;
Grid.ExportSettings.ExportOnlyData =
true
;
Grid.ExportSettings.OpenInNewWindow =
true
;
Grid.ExportSettings.FileName =
"filename"
;
Grid.MasterTableView.ExportToExcel();
Grid.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
<telerik:RadGrid
ShowGroupPanel =
"false"
AutoGenerateColumns =
"false"
ID =
"Grid"
AllowFilteringByColumn =
"False"
AllowSorting =
"False"
ShowFooter =
"True"
runat =
"server"
GridLines =
"Both"
AllowPaging =
"false"
EnableLinqExpressions =
"false"
CssClass =
"RadGridCustomClass"
OnPreRender =
"Grid_PreRender"
OnExcelMLExportRowCreated=
"Grid_ExcelMLExportRowCreated"
OnGridExporting =
"Grid_GridExporting"
OnExcelMLExportStylesCreated=
"Grid_ExcelMLExportStylesCreated"
OnItemDataBound =
"Grid_ItemDataBound"
>
<PagerStyle Mode=
"NextPrevAndNumeric"
/>
<MasterTableView
ShowGroupFooter =
"true"
HeaderStyle-Font-Bold =
"true"
HeaderStyle-ForeColor =
"#333333"
AllowMultiColumnSorting =
"false"
>
<Columns>
<telerik:GridBoundColumn
DataField =
"SubCategory"
ItemStyle-HorizontalAlign =
"Center"
UniqueName =
"REP013_FuellingCategoryHeaderText"
FooterStyle-HorizontalAlign =
"Center"
FooterStyle-Font-Bold =
"true"
HeaderStyle-HorizontalAlign =
"Center"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn
Aggregate =
"Sum"
DataField =
"Total_Fuel_Litres"
DataType =
"System.Int32"
UniqueName =
"REP013_TotalFuelHeaderText"
DataFormatString =
"{0:###,###.##}"
ItemStyle-HorizontalAlign =
"Center"
FooterStyle-HorizontalAlign =
"Center"
FooterStyle-Font-Bold =
"true"
HeaderStyle-HorizontalAlign =
"Center"
FooterText =
"<%$ Resources:MyGlobals, REP013_TotalFuelFooterText%>"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn
Aggregate =
"Avg"
DataField =
"Bio_Content"
DataFormatString =
"{0:0.0%}"
UniqueName =
"REP013_BioContentHeaderText"
ItemStyle-HorizontalAlign =
"Center"
FooterStyle-HorizontalAlign =
"Center"
FooterStyle-Font-Bold =
"true"
HeaderStyle-HorizontalAlign =
"Center"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn
Aggregate =
"Sum"
DataField =
"Bio_Diesel_Litres"
DataFormatString =
"{0:###,###}"
UniqueName =
"REP013_BioDieselHeaderText"
ItemStyle-HorizontalAlign =
"Center"
FooterStyle-HorizontalAlign =
"Center"
FooterStyle-Font-Bold =
"true"
HeaderStyle-HorizontalAlign =
"Center"
FooterText =
"<%$ Resources:MyGlobals, REP013_BioDieselFooterText%>"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn
Aggregate =
"Sum"
DataField =
"Standard_Diesel_Litres"
DataFormatString =
"{0:###,###}"
UniqueName =
"REP013_StandardDieselHeaderText"
ItemStyle-HorizontalAlign =
"Center"
FooterStyle-HorizontalAlign =
"Center"
FooterStyle-Font-Bold =
"true"
HeaderStyle-HorizontalAlign =
"Center"
FooterText =
"<%$ Resources:MyGlobals, REP013_StandardDieselFooterText%>"
>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn
Aggregate =
"Sum"
DataField =
"CO2_Tonnes"
DataFormatString =
"{0:###,##0.0}"
UniqueName =
"REP013_CO2QuantityHeaderText"
ItemStyle-HorizontalAlign =
"Center"
FooterStyle-HorizontalAlign =
"Center"
FooterStyle-Font-Bold =
"true"
HeaderStyle-HorizontalAlign =
"Center"
FooterText =
"<%$ Resources:MyGlobals, REP013_CO2QuantityFooterText%>"
>
</telerik:GridBoundColumn>
</Columns>
<GroupByExpressions>
<telerik:GridGroupByExpression>
<SelectFields>
<telerik:GridGroupByField FieldName=
"Category"
/>
</SelectFields>
<GroupByFields>
<telerik:GridGroupByField FieldName=
"Category"
SortOrder=
"Ascending"
/>
</GroupByFields>
</telerik:GridGroupByExpression>
</GroupByExpressions>
</MasterTableView>
<ClientSettings AllowDragToGroup =
"false"
/>
<GroupingSettings ShowUnGroupButton =
"false"
/>
</telerik:RadGrid>