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

GridHyperlink items not exporting to excel

5 Answers 151 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Karl Wilkens
Top achievements
Rank 1
Karl Wilkens asked on 13 Jun 2008, 01:40 PM
Hi,

We have several columns of type GridHyperLink which, when exported to excel, render as blank - no data. Is there a trick to getting links to export in Excel? Thanks.

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 16 Jun 2008, 06:46 AM
Hi Karl,

Check out the following help document link.
Exporting tips and tricks

Thanks
Princy.
0
Ujwala
Top achievements
Rank 1
answered on 07 Aug 2014, 11:23 AM
pl help on same issue its urgent
0
Shinu
Top achievements
Rank 2
answered on 07 Aug 2014, 11:46 AM
Hi Pinky,

Its hard to replicate the issue without your code. Please try the following sample code snippet and check if it helps you to resolve the issue else provide your full code snippet.

ASPX:
<telerik:RadGrid ID="rgrdSample" runat="server" AutoGenerateColumns="false" AllowPaging="true" AllowFilteringByColumn="true" OnNeedDataSource="rgrdSample_NeedDataSource">
    <ExportSettings IgnorePaging="true" ExportOnlyData="true" OpenInNewWindow="true">
    </ExportSettings>
    <MasterTableView CommandItemDisplay="Top" CommandItemSettings-ShowExportToExcelButton="true">
        <Columns>
            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" />
            <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name" />
            <telerik:GridHyperLinkColumn DataTextFormatString="Search Google for '{0}'" DataNavigateUrlFields="Country" HeaderText="Country" UniqueName="Country" DataNavigateUrlFormatString="http://www.google.com/search?hl=en&q={0}&btnG=Google+Search" DataTextField="Country">
            </telerik:GridHyperLinkColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

C#:
protected void rgrdSample_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
  {
        dynamic data = new[] {
    new { ID = 1, Name = "Name1", Country="India"},
    new { ID = 2, Name = "Name2", Country="USA"},
    new { ID = 3, Name = "Name3", Country="Egypt"},
    new { ID = 4, Name = "Name4", Country="Canada"},
    new { ID = 5, Name = "Name5", Country="India"},
    new { ID = 6, Name = "Name6", Country="London"},
    new { ID = 7, Name = "Name7", Country="USA"},
    new { ID = 8, Name = "Name8", Country="USA"},
    new { ID = 9, Name = "Name9", Country="Paris"}
    };
        rgrdSample.DataSource = data;
  }

Thanks,
Shinu
0
Ujwala
Top achievements
Rank 1
answered on 07 Aug 2014, 12:58 PM
Hi Shinu,

   thanks for reply very quickly. The solution is not worked for my requirements. i am binding data dynamically. so how to convert hyperlink column to text. pl help me.


Thanks,
pinky
0
Shinu
Top achievements
Rank 2
answered on 08 Aug 2014, 03:49 AM
Hi Pinky,

I'm not clear about your requirement. Can you please provide a sample code snippet to replicate the issue you are facing and elaborate on your requirement for further help.

Thanks,
Shinu
Tags
Grid
Asked by
Karl Wilkens
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Ujwala
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or