Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Gridview Dynamic DataNavigateUrlformatString ProblemGridview Dynamic DataNavigateUrlformatString Problem
Previous
 
Next
New Post
3/19/2009 5:43 PM
 

I'm doing conversion of a web app to a DNN module and they used a gridview with a HyperLinkField. No problem there except I need to make it dynamic. I figured out how to do it on the RowDataBound and it works except for the first line in the grid. It never forms the proper URL.

Below is my code

If e.Row.RowType = DataControlRowType.DataRow Then
   If e.Row.Cells(3).Text.Length > 150 Then
      e.Row.Cells(3).Text = e.Row.Cells(3).Text.ToString.Substring(0, 150) & [...]"
   End If

   Dim dField As DataControlFieldCell = CType(e.Row.Cells(2), DataControlFieldCell)
   Dim hlf As HyperLinkField = CType(dField.ContainingField, HyperLinkField)
   hlf.DataNavigateUrlformatString = NavigateURL(TabId, "", "MenuItem=ViewCourse&Course={0}")

End If

The .asxc line looks like this

<asp:HyperLinkField DataNavigateUrlFields="CourseNumber" DataTextField="Name" ItemStyle-Font-Bold="true" SortExpression="Name" HeaderText="Name" />

Can anyone point me to what I'm missing

 
New Post
3/19/2009 5:59 PM
 

I have a similar module I wrote for some time my code is

If e.Row.RowType = ListItemType.Item Or _
e.Row.RowType = ListItemType.AlternatingItem Then

 

I dont remeber why I did it so, there is no reason for doing it for alternating anf normal but maybe I had similar problem as you and this work. Give it a try.

 

 

 
New Post
3/20/2009 11:49 AM
 

I'll check again but I don't think the Gridview object has a ListItemType. Just a DataControlType that has the properties DataRow, EmptyDataRow, Footer, Header, Pager, Separator..

The thing that gets me is the .cells(3).Text.Length > 150 portion of the procedure works perfectly. It's just when I'm trying to manipulate the URL that things go sideways on the first row.

 
New Post
3/20/2009 12:06 PM
 

I am sure that it has:)

Do you think I am drunk?

 

 
New Post
3/20/2009 1:08 PM
 

No. Just saying that when I was looking at this yesterday that under RowDataBound the ListItemType wasn't one of the options.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Gridview Dynamic DataNavigateUrlformatString ProblemGridview Dynamic DataNavigateUrlformatString Problem


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out