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

[Solved] Enable download via hyperlink

3 Answers 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
JungTae
Top achievements
Rank 1
JungTae asked on 10 Nov 2010, 05:14 PM
Hello Telerik team. I am currently using Silverlight 3 DLLs on VSTS 2008, and I have a link to an excel file on our server which is displayed in the hyperlinkcolumn of RadGridView. I want to allow the user to download the excel file when the user clicks on the link. How can this effect be achieved? I do not necessarily have to use hyperlinkColumn, whichever method that works will do

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 11 Nov 2010, 08:44 AM
Hello JungTae,

If you can achieve this with a simple hyperlink button then you should be able to do the same with the RadGridView's hyperlink column.


Regards,
Veselin Vasilev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
JungTae
Top achievements
Rank 1
answered on 12 Nov 2010, 06:00 PM
I am current using onClick eventhandler to enable the download with my hyerlink on my page right now. How should I implement this event hadler using the hyperlinkColumn? here is the code that I'm using with my current hyperlinkbutton

private void sampleCSVHyperLink_Click(object sender, RoutedEventArgs e)
{
    SaveFileDialog saveDialog = new SaveFileDialog();
    saveDialog.DefaultExt = ".csv";
    saveDialog.Filter = "CSV Files|*.csv";
    saveDialog.FilterIndex = 1;
  
    bool? dialogResult = saveDialog.ShowDialog();
  
    if (dialogResult == true)
    {
        busyIndicator.IsBusy = true;
        localWriteFile = saveDialog.OpenFile();
        proxy.DownloadCSVTemplateAsync(this.pricingModel.ModelName);
     }
}
0
Veselin Vasilev
Telerik team
answered on 15 Nov 2010, 09:09 AM
Hello JungTae,

In this case I would suggest to use the CellTemplate of the gridview column and put a Hyperlink button there. You can subscribe to its Click event and execute that code upon clicking just as you did outside the gridview.

Hope this helps

Best wishes,
Veselin Vasilev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
JungTae
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
JungTae
Top achievements
Rank 1
Share this question
or