is this too heavy

G

Guest

hey all,

i was wondering if the following code, in general, if it wouldn't always be
a good idea or if there's a better way to do it.

Private Sub DataGrid2_ItemDataBound(ByVal sender As Obj...
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
Dim lnb As LinkButton
lnb = e.Item.Cells(1).FindControl("LinkButton1")
lnb.Text = e.Item.DataItem("OrderID")
End If

All i'm trying to do is take a field in each row of the datasource and
assign it to the text of a link button so users can click it.

Thanks,
rodchar
 
S

Steve C. Orr [MVP, MCSD]

This looks like perfectly good code to me.
I've used similar code successfully before.
 

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,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top