Two issues:
1) I am trying to export a radgrid to CSV. The button is configured to call back to C# and I see the code hit MasterTableView.ExportToCSV(), but I step over that line and nothing happens.
2) After hitting the export button and going through the code, the data in the table disappears.
ASP
C#
I'm very new to this so I'm sure I'm missing something obvious but could use some help being pointed in the right direction.
Thanks
1) I am trying to export a radgrid to CSV. The button is configured to call back to C# and I see the code hit MasterTableView.ExportToCSV(), but I step over that line and nothing happens.
2) After hitting the export button and going through the code, the data in the table disappears.
ASP
<
telerik:RadGrid
ID
=
"rgResources"
runat
=
"server"
AutoGenerateColumns
=
"false"
ShowGroupPanel
=
"false"
OnPreRender
=
"rgResources_PreRender1"
OnColumnCreated
=
"rgResources_ColumnCreated"
OnItemCommand
=
"rgResources_ItemCommand"
GroupingEnabled
=
"false"
ShowFooter
=
"true"
>
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"false"
></
Selecting
>
<
Scrolling
AllowScroll
=
"true"
SaveScrollPosition
=
"true"
FrozenColumnsCount
=
"2"
UseStaticHeaders
=
"true"
ScrollHeight
=
"150px"
></
Scrolling
>
</
ClientSettings
>
<
MasterTableView
DataKeyNames
=
"Resource"
CommandItemDisplay
=
"Top"
AllowSorting
=
"false"
AutoGenerateColumns
=
"true"
ShowGroupFooter
=
"true"
>
<
CommandItemSettings
ShowExportToCsvButton
=
"true"
ShowAddNewRecordButton
=
"false"
ShowRefreshButton
=
"false"
/>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
>
</
ExpandCollapseColumn
>
</
MasterTableView
>
<
ExportSettings
IgnorePaging
=
"true"
>
<
Csv
FileExtension
=
"CSV"
/>
</
ExportSettings
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
<
ClientSettings
EnableRowHoverStyle
=
"true"
>
</
ClientSettings
>
</
telerik:RadGrid
>
C#
protected void rgResources_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName)
{
rgResources.MasterTableView.ExportToCSV();
}
}
I'm very new to this so I'm sure I'm missing something obvious but could use some help being pointed in the right direction.
Thanks