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

export data in word using radgrid

1 Answer 38 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Coolbudy
Top achievements
Rank 1
Coolbudy asked on 26 Nov 2012, 07:37 AM
hey guys,


   I want to export my radgrid data in word document but without using sqldatasource how can i do that?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Nov 2012, 08:23 AM
Hi,

Please take a look into the following code snippet I tried to export grid without using SqlDataSource.

ASPX:
<telerik:RadGrid ID="RadGRid" runat="server" AutoGenerateColumns="false" AutoGenerateEditColumn="true"
    OnNeedDataSource="RadGRid_NeedDataSource" AllowFilteringByColumn="true" >
    <MasterTableView CommandItemDisplay="Top">
        <CommandItemSettings ShowExportToWordButton="true" />
        <Columns>
            <telerik:GridBoundColumn DataField="" HeaderText="Object">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <ClientEvents />
    </ClientSettings>
</telerik:RadGrid>

C#:
protected void RadGRid_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    List<string> data = new List<string> { "a", "b", "c" };
    RadGRid.DataSource = data;
}

Thanks,
Shinu.
Tags
General Discussions
Asked by
Coolbudy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or