All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
"server"
OnNeedDataSource
"RadGrid1_NeedDataSource"
AutoGenerateColumns
"false"
AllowMultiRowSelection
"true"
>
MasterTableView
Columns
telerik:GridBoundColumn
DataField
"Column1"
HeaderText
</
"Column2"
"Column3"
"Column4"
"Column5"
ClientSettings
Selecting
AllowRowSelect
/>
asp:Button
Text
"Export to Excel"
"Button1"
OnClick
"Button1_Click"
protected
void
RadGrid1_NeedDataSource(
object
sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
DataTable table =
new
DataTable();
table.Columns.Add(
);
for
(
int
i = 0; i < 20; i++)
table.Rows.Add(
"Col1Row"
+ i,
"Col2Row"
"Col3Row"
"Col4Row"
"Col5Row"
+ i);
}
RadGrid1.DataSource = table;
Button1_Click(
sender, EventArgs e)
foreach
(GridDataItem item
in
RadGrid1.MasterTableView.Items)
if
(!item.Selected)
item.Visible =
false
;
RadGrid1.ExportSettings.IgnorePaging =
RadGrid1.ExportSettings.FileName =
"Document"
RadGrid1.MasterTableView.ExportToExcel();