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

email hyperlink in radgrid not working

3 Answers 216 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 01 Dec 2012, 05:51 PM
In a regualr asp griwview the following scenerio with a hyperlink emial button works just fine and opens outlook to send an email to a person, but when I put this same functionality into a radgrid, it opens up outlook, but then also forwards the current page the radgrid is on to the email of the person and errors out the application. Id there a way to create this same functionality in a radgrid.  Right now where they need the clickable email functionality on a page I have to use griwviews and am using a combination of gridviews and radgrids in projects, i would rather use radgrids for increased fucntionality.  Please solve this issue.

 <asp:GridView ID="myGridView" runat="server" Font-Size="10" HeaderStyle-HorizontalAlign="Center" BorderWidth="1px" CellPadding="6" GridLines="Both" BorderColor="#404040"
                                    Font-Names="Veranda,arial,sans-serif" AutoGenerateColumns="false" CellSpacing="0" Width="100%" RowStyle-HorizontalAlign="left" DataKeyNames="intLocationId"><AlternatingRowStyle BackColor="#b0c4de" />
                                    <HeaderStyle Font-Bold="true" ForeColor="White" BackColor="SteelBlue" />
                                        <Columns>
                                            <asp:TemplateField HeaderText="Contact">
                                                <ItemTemplate>
                                                    <asp:HyperLink NavigateUrl='<%# Bind("strFTEmail", "mailto:{0}") %>' Text='<%# Bind("strFullname") %>' runat="server" ID="hlEmail"></asp:HyperLink>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="strPhone" HeaderText="Contact #" />
                                        </Columns>
                                    </asp:GridView>

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Dec 2012, 04:57 AM
Hi,

Unfortunately I cannot replicate the issue at my end. One suggestion is that you can use a GridHyperLinkColumn as shown below.
aspx:
<telerik:GridHyperLinkColumn DataNavigateUrlFields="strFTEmail" UniqueName="strFTEmail" DataNavigateUrlFormatString="mailto:{0}" DataTextField="strFTEmail"></telerik:GridHyperLinkColumn>

Thanks,
Shinu.
0
Kevin
Top achievements
Rank 1
answered on 03 Dec 2012, 03:39 PM
Hi Shinu,

Ok here is what i have noticed, If I take that functionality and put within a MAster page, like mine are, it will forward the page and open up outlook.  However if I have it in its own page then the functionality works fine and it stays on page and opens outlook.  The problem is all my menus are in the master page use them or rebuild all that functionality where i need the email link which is a pain.
0
Milena
Telerik team
answered on 06 Dec 2012, 01:04 PM
Hello,

I tested your scenario with RadGrid and it works as expected on my end. Attached, you can find the project, which I used for testing. Please modify it in order to replicate the problem and let me know what I am missing.

All the best,
Milena
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Kevin
Top achievements
Rank 1
Milena
Telerik team
Share this question
or