export data in word using radgrid

2 posts, 0 answers
  1. Coolbudy
    Coolbudy avatar
    24 posts
    Member since:
    Nov 2012

    Posted 26 Nov 2012 Link to this post

    hey guys,


       I want to export my radgrid data in word document but without using sqldatasource how can i do that?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 26 Nov 2012 Link to this post

    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.
Back to Top