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

Export buttons in CommandItemTemplate

1 Answer 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 07 May 2008, 04:44 PM
Is there an easy way to place excel and word export images (image buttons) into the CommandItemTemplate and handle these events - and be able to format the output to excel? If so can an example be provided because whatever I try doesn't work. Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 May 2008, 06:52 AM
Hi Darren,

You can achieve this by placing an ImageButton in the CommandItemTemplate.

ASPX:
<CommandItemTemplate> 
    <asp:ImageButton ID="ImageButton2" ImageUrl="~/Image1.gif" runat="server" OnClick="ImageButton2_Click" /> 
</CommandItemTemplate> 


CS:
protected void ImageButton2_Click(object sender, ImageClickEventArgs e) 
    { 
        RadGrid1.ExportSettings.ExportOnlyData = true
        RadGrid1.MasterTableView.ExportToWord(); 
    } 


Thanks
Shinu.
Tags
Grid
Asked by
Darren
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or