There are a few ways to read data. Did you want to read it at Data Bind
time? If so, you can use the ItemDataBound event to evaluate the data.
Then from there you can hide or show the list item. Or you can loop through
the list and decide.
To Loop:
Dim myItem as DataListItem
For Each myItem in Datalist1.Items
'Add code here to validate and take action.
Loop
DataBind: (From MSDN Library Help)
Private Sub DataList1_ItemDataBound(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) _
Handles DataList1.ItemDataBound
Dim dob As DateTime
Dim doblabel As Label
doblabel = CType(e.Item.FindControl("Label1"), Label)
dob = CType(doblabel.Text, DateTime)
If dob.Month = Today.Month Then
e.Item.BackColor = Color.Yellow
End If
End Sub
"Per W." <pe**@tiscali.nowrote in message
news:ej**********@troll.powertech.no...
>
"Jeff Allan" <bo******@community.nospamskrev i melding
news:eO**************@TK2MSFTNGP02.phx.gbl...
>What is the item? Does the dataset have many tables or just one? Can
you provide more specifics?
Sorry, its datalist, not dataset and one table. if i use the gridview then
i can use the rowdatabound and e.row.cells(number).text to read the
context of the cell. But i want to use datalist and read the context of a
item in that datalist.
/Per W.