Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid Sorting Link Issue

Status
Not open for further replies.

LittlBUGer

Programmer
Apr 26, 2006
81
US
Hello again. Somewhat related to my previous post, I have a datagrid which is autogenerated by binding to a table in a SQL Server 2000 database. Though I can't capture the column header text after the datagrid is bound, I can change it to whatever I want. The problem is that once I change it, the sort link on the header goes away so it's just plain text. I need to keep the sorting ability there, so how do I get that sort link back when I change the header text? Thanks for the help. :)

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein
 
Nevermind, I think I got it working. All it took was basically this code in the OnDataBound area:

Code:
Dim anint As Integer = 0
Dim tmpnum As Integer = (session("dg5acolumncount") - 1)
For anint = 2 to tmpnum Step 3
	e.Item.Cells(anint).Text = "<a href=""javascript:__doPostBack('dispreport5a$_ctl1$_ctl" & anint & "','')"">Bill</a>"
Next

:)

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top