Hello, I have a WebDataGrid with the TemplateDataField shown below. First, I would like to get a value from the first column in each row, then I would like to create the NavigateUrl value for each TemplateDataField in the WebDataGrid. Please help with codebehind values for WebDataGrid1_InitializeRow Sub.
<ig:TemplateDataField Key="View"> <ItemTemplate> <asp:HyperLink ID="hlView" runat="server" Target="blank">View</asp:HyperLink> </ItemTemplate> </ig:TemplateDataField>
Thanks much! Dave
Hi Dave,
I'm glad to hear you found a solution! Thank you for posting it on our forums.
Michael, after many trial annd error I came up with the solution below.
Dim x As StringDim FileId As Integer = Convert.ToInt32(e.Row.DataKey(0))Dim navURL As String = "~/FileStream.ashx?File_Id=" + FileId.ToString
For i As Integer = 0 To e.Row.Items.Count - 1 x = e.Row.Items(i).Column.Key Select Case x Case "View" Dim hlView As HyperLink = e.Row.Items(i).FindControl("hlView") hlView.NavigateUrl = navURL End SelectNext
Thanks, Dave
Thanks Michael...my codebehind is in VB. Please provide solution as VB too.
Much appreciated!!!
Dear Dave,
Thank you for contacting Infragistics!
We have received your support request concerning setting the NavigateUrl in a TemplateDataField during InitializeRow, and this case has been assigned to me. Infragistics is dedicated to helping you solve this issue. Our team and I have done an initial review of your case and I am looking into the methods to achieve this and will get back to you by the end of Tuesday with more information or questions for you.
Looking forward to hearing from you.