Hi. I have a radgrid with a command item template. I have Add New Record open a radwindow. I have an imagebutton for export to excel, and I set it up like the demo suggests (http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/pdfexport/defaultcs.aspx), but instead of exporting, it hides the command items. I am posting my code below. Could you please let me know what I am doing wrong?
Thank you.
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
script
type
=
"text/javascript"
>
function onRequestStart(sender, args) {
if (args.get_eventTarget().indexOf("excelExport") > 0) {
args.set_enableAjax(false);
}
}
function ShowInsertForm() {
var combo = $find("<%= RadComboBox1.ClientID %>");
var comboItem = combo.get_selectedItem();
if (!comboItem)
{
window.radopen("AddComment.aspx", "UserListDialog");
}
else {
window.radopen("AddComment.aspx?something=" + comboItem.get_value("something"), "UserListDialog");
}
return false;
}
function refreshGrid() {
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
</
script
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
GridLines
=
"None"
Skin
=
"WebBlue"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
OnDataBound
=
"RadGrid1_DataBound"
width
=
"873px"
AutoGenerateColumns
=
"False"
>
<
ExportSettings
ExportOnlyData
=
"true"
IgnorePaging
=
"true"
OpenInNewWindow
=
"true"
>
<
Excel
Format
=
"ExcelML"
/>
</
ExportSettings
>
<
ClientSettings
AllowColumnsReorder
=
"True"
ReorderColumnsOnClient
=
"True"
>
</
ClientSettings
>
<
MasterTableView
CommandItemDisplay
=
"Top"
>
<
CommandItemSettings
>
</
CommandItemSettings
>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"something0"
HeaderText
=
"Grantee"
UniqueName
=
"column"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"something"
HeaderText
=
"PO"
UniqueName
=
"column1"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"something1"
FilterControlWidth
=
"30px"
HeaderText
=
"Comment Date"
UniqueName
=
"column2"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"something2"
HeaderText
=
"Commentor"
UniqueName
=
"column3"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"something3"
HeaderText
=
"Comment"
UniqueName
=
"column4"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"InsertDate"
FilterControlWidth
=
"30px"
HeaderText
=
"Insert Date"
UniqueName
=
"something4"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
CommandItemTemplate
>
<
a
href
=
"#"
onclick
=
"return ShowInsertForm();"
>Add New Record</
a
>
<
asp:ImageButton
ID
=
"excelExport"
runat
=
"server"
ImageUrl
=
"~/images/ExportToExcel.gif"
CommandName
=
"ExportToExcel"
/>
</
CommandItemTemplate
>
</
MasterTableView
>
</
telerik:RadGrid
>
Thank you.