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

[Solved] GridViewDynamicHyperlinkColumn "mailto:{0}" opens new browser window

3 Answers 201 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.
Vassili King
Top achievements
Rank 1
Vassili King asked on 17 Dec 2010, 11:00 PM
Hello,

I've been trying to replicate (in a way) the functionality demonstrated on Telerik's web site: http://demos.telerik.com/silverlight/#GridView/ColumnTypes.

They (Telerik) have a mailto link in the grid defined in the following way:

                <telerik:GridViewDynamicHyperlinkColumn DataMemberBinding="{Binding FirstName}" Header="Send e-mail to:" NavigateUrlFormatString="mailto:{0}.{1}@yourdomain.com?subject=Your subject&amp;body=Your text"
                                                         NavigateUrlMemberPaths="FirstName,LastName" TargetName="_blank">
                    <telerik:GridViewDynamicHyperlinkColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="e-mail: " />
                                <TextBlock Text="{Binding FirstName}" />
                                <TextBlock Text="." />
                                <TextBlock Text="{Binding LastName}" />
                                <TextBlock Text="@yourdomain.com" />
                            </StackPanel>
                        </DataTemplate>
                    </telerik:GridViewDynamicHyperlinkColumn.CellTemplate>
                </telerik:GridViewDynamicHyperlinkColumn>

In the demo, once you click the hyperlink, the new email template is opened (if you have a default mail program installed such as Outlook).  When I'm doing the same thing in my grid, the email template also opens fine, BUT a new browser window pops up and stays there.  Telerik's version does not have the popup window (at least i didn't see it).  How do I prevent the window from poping up?

I've tried a couple of different ways, both have the popup...

#1:
                        <telerik:GridViewDynamicHyperlinkColumn DataMemberBinding="{Binding Email}" Header="Email" NavigateUrlFormatString="mailto:{0}"
                                                                NavigateUrlMemberPaths="Email" TargetName="_blank">
                            <telerik:GridViewDynamicHyperlinkColumn.CellTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="e-mail: " />
                                        <TextBlock Text="{Binding Email}" />
                                    </StackPanel>
                                </DataTemplate>
                            </telerik:GridViewDynamicHyperlinkColumn.CellTemplate>
                        </telerik:GridViewDynamicHyperlinkColumn>


#2:
                        <telerik:GridViewDynamicHyperlinkColumn DataMemberBinding="{Binding Email}" Header="" NavigateUrlFormatString="mailto:{0}"
                                                                NavigateUrlMemberPaths="Email" TargetName="_blank">
                            <telerik:GridViewDynamicHyperlinkColumn.CellTemplate>
                                <DataTemplate>
                                    <Image Source="images/email_small.jpg" ToolTipService.ToolTip="Click to send and Email."/>
                                </DataTemplate>
                            </telerik:GridViewDynamicHyperlinkColumn.CellTemplate>
                        </telerik:GridViewDynamicHyperlinkColumn>



Thank you!

-VK.

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 20 Dec 2010, 08:58 AM
Hello,

 We do not have any code that opens popup windows. What is your email client and default browser? 

Greetings,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Vassili King
Top achievements
Rank 1
answered on 20 Dec 2010, 05:32 PM
I'm with you on this one, Vlad.  Your demo does not open any popups.  However, once I use the (pretty much) same code in my project, clicking on the hyperlink does open a new browser window with mailto:email@domain.com in the address bar, and then the default mail client is launched.  Both (your example and my project) are ran in the same OS build:  Windows 7, IE 8, Outlook 2010.  I'm using Q2 of the Telerik Silverlight controls.  This is weird that two projects with basically the same code result in different behavior.  Yours is what I'm trying to achieve.

Thank you!
-VK.
0
Joel Tipke
Top achievements
Rank 1
answered on 21 Jan 2011, 12:39 AM
We are also experiencing this issue. It appears to be related to the Enable Protected Mode option in Internet Explorer security settings. This explains why the Telerik web site example works perfectly but running locally, or on an intranet site, brings up the extra window.  Any assistance would be appreciated.
Tags
GridView
Asked by
Vassili King
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Vassili King
Top achievements
Rank 1
Joel Tipke
Top achievements
Rank 1
Share this question
or