Sorting when Auto-generating HyperLink Coloumnsm HELP!!!

  • Thread starter Christopher Calhoun
  • Start date
C

Christopher Calhoun

Using code like this.

Private Sub DataGrid1_ItemDataBound _
(ByVal sender As Object, ByVal e As _
System.Web.UI.WebControls.DataGridItemEventArgs) _
Handles DataGrid1.ItemDataBound
Dim tblcell As TableCell
Dim intCounter As Integer
Dim hlnkcntrl As HyperLink
For intCounter = 0 To e.Item.Cells.Count - 1
tblcell = e.Item.Cells(intCounter)
hlnkcntrl = New HyperLink
hlnkcntrl.Text = tblcell.Text
hlnkcntrl.NavigateUrl = "thepage.aspx"
tblcell.Text = ""
tblcell.Controls.Add(hlnkcntrl)
Next
End Sub


When this code is added all my sorting ability and Headers are removed.
What gives??


Thanks in Advance!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top