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

Hyperlink In Grid Column When Using RowClick Command

1 Answer 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 18 May 2009, 04:50 PM
I have a grid that uses the row click command to open a NestedView like so:

If e.CommandName = "RowClick" Then 
            Dim item As GridDataItem = e.Item 
            If item.Expanded = True Then 
                item.Expanded = False 
            Else 
                item.Expanded = True 
            End If 
        End If 

But I also Have a column that I want to display an email address in and have that clickable as well.  When I click it now it still only opens the row instead of redirecting the page like so:

<telerik:GridTemplateColumn DataField="email" HeaderText="Email Address"  
            SortExpression="email" UniqueName="email"
            <ItemTemplate> 
            <href='message_center.aspx?record=<%# Eval("record") %>'><asp:Label ID="emailLabel" runat="server" Text='<%# Eval("email") %>'></asp:Label></a
            </ItemTemplate> 
        </telerik:GridTemplateColumn> 

How can I achieve this?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 19 May 2009, 07:31 AM
Hi Shawn,

I was also able to replicate this issue on my end. From my understanding the RowClick event is getting fired on clicking the hyperlink as well. So one possible workaround was to identify whether clicked element is a row or a hyperlink and then cancel the RowClick event accordingly. But telerik themselves had pointed out in their help article that the RowClick event cannot be cancelled. I hope telerik can shed some light on this issue.

Shinu

Tags
Grid
Asked by
Shawn
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or