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

Opening Window from Hierarchial Grid Using Hyperlink

3 Answers 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 10 Mar 2011, 10:38 PM
I'm using the code from the demo Grid / Window Editing. 

This part of the code doesn't work. 

 

 

Dim Details As HyperLink = DirectCast(e.Item.FindControl("DetailsLink"), HyperLink)

 

 

Details is set to nothing.

 


3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Mar 2011, 08:56 AM
Hello Michael,

Check whether you have set the ID of HyperLink as 'DetailsLink' in mark up.

ASPX:
<telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
   <ItemTemplate>
     <asp:HyperLink ID="DetailsLink" runat="server" Text="Details"></asp:HyperLink>
   </ItemTemplate>
</telerik:GridTemplateColumn>

Thanks,
Princy.
0
Michael
Top achievements
Rank 1
answered on 14 Mar 2011, 07:34 PM
Princy,

I've checked the ID and it's set to DetailsLink.

Do you think this has anything to do with this being a hierarchial grid?

0
Accepted
Tsvetoslav
Telerik team
answered on 15 Mar 2011, 01:11 PM
Hi Michael,

It does matter if the template column containing the hyperlink is in the detail table. In this case, you should set the Name property of the detail GridTableView and then try accessing the hyperlink as follows:

if(e.Item == GridDataItem && e.Item.OwnerTableView.Name == "DetailTableViewName")
{
   ...
}

Furthermore, make sure that you are using Advanced data-binding for the grid (if you are not employing data-source controls).

Hope it helps.
 


Best wishes,
Tsvetoslav
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Michael
Top achievements
Rank 1
Tsvetoslav
Telerik team
Share this question
or