Hi,
We use Telerik grid for VS2008, version 2011.3.1115.0.
I have 2 issues:
1) When I create columns manually in this way:
The code behind is as follows:
When I export grid to Excel file the Boolean values from first check box column are exported as well. How can I export all data but without those Boolean values?
2) When I want to export data only from selected rows from grid that contains the first check box column to Excel file using the following code:
not only selected rows, but whole grid was exported.
How can I solve these 2 issues?
Thank you in advance.
Goran
We use Telerik grid for VS2008, version 2011.3.1115.0.
I have 2 issues:
1) When I create columns manually in this way:
<
div
style
=
"margin-right: 20px;"
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
Width
=
"100%"
DataSourceID
=
"SqlDataSource1"
AllowAutomaticDeletes
=
"true"
AllowAutomaticInserts
=
"true"
AllowAutomaticUpdates
=
"true"
AutoGenerateColumns
=
"false"
AllowMultiRowSelection
=
"true"
>
<
MasterTableView
PageSize
=
"10"
AllowPaging
=
"True"
Width
=
"100%"
DataKeyNames
=
"ContinentID"
DataSourceID
=
"SqlDataSource1"
EditMode
=
"InPlace"
>
<
Columns
>
<
telerik:GridClientSelectColumn
></
telerik:GridClientSelectColumn
>
<
telerik:GridBoundColumn
HeaderText
=
"ContinentID"
DataField
=
"ContinentID"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderText
=
"ContinentName"
DataField
=
"ContinentName"
></
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
ClientEvents
OnRowContextMenu
=
"RowContextMenu"
></
ClientEvents
>
<
Selecting
AllowRowSelect
=
"true"
></
Selecting
>
</
ClientSettings
>
</
telerik:RadGrid
>
</
div
>
The code behind is as follows:
RadGrid1.ExportSettings.ExportOnlyData =
true
;
RadGrid1.ExportSettings.IgnorePaging =
true
;
RadGrid1.ExportSettings.OpenInNewWindow =
true
;
RadGrid1.MasterTableView.ExportToExcel();
When I export grid to Excel file the Boolean values from first check box column are exported as well. How can I export all data but without those Boolean values?
2) When I want to export data only from selected rows from grid that contains the first check box column to Excel file using the following code:
foreach
(GridDataItem item
in
RadGrid1.Items)
{
if
(item.Selected ==
false
)
{
item.Visible =
false
;
}
}
RadGrid1.ExportSettings.ExportOnlyData =
true
;
RadGrid1.ExportSettings.IgnorePaging =
true
;
RadGrid1.ExportSettings.OpenInNewWindow =
true
;
RadGrid1.MasterTableView.ExportToExcel();
not only selected rows, but whole grid was exported.
How can I solve these 2 issues?
Thank you in advance.
Goran