This is a migrated thread and some comments may be shown as answers.

Custom Button in Header

1 Answer 286 Views
Grid
This is a migrated thread and some comments may be shown as answers.
GD
Top achievements
Rank 1
GD asked on 02 Mar 2011, 03:17 PM
I do not want to use "CommandItemTemplate".
I want to add a only button on CommandItem.

My code:

<CommandItemSettings ShowExportToExcelButton=true  ExportToExcelImageUrl="~/App_Themes/SETheme/SESkin/Grid/MyImage.gif" />

<script type="text/javascript">
//<![CDATA[
function MyFunction() {
}
//]]>
</script>


protected void radGrid_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
       {
           if (e.Item is GridCommandItem)
           {
               e.Item.FindControl("InitInsertButton").Visible = false;
                 
               LinkButton Export = e.Item.FindControl("ExportToExcelButton") as LinkButton;
               Export.OnClientClick = "javascript:ExportTxt(); return false;";
           }
       



My code is Ok ...but It's a workaround.
Is there a cleaner way?

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 02 Mar 2011, 03:47 PM
Hello Claudio,

Please refer to the following help article for more information about the CommandItem of the RadGrid.
http://www.telerik.com/help/aspnet-ajax/grid-commanditem-default-behavior.html

Greetings,
Pavlina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Grid
Asked by
GD
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or