D
Dhruv
Hi,
I have a question
I have a grid
it is spitting this out
description
-----------
test1
test2
test3
I want to change it so that on ItemDataBound each row/value of
description column runs through a string function I pass it.
How do I do that?
here is my code so far:
Private Sub grdReadingNews_ItemDataBound(ByVal sender As Object, ByVal
e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
grdReadingNews.ItemDataBound
' below determines the column of the row that one should check
for (dataRowView)
'cint(e.item.itemIndex) is the actual row that it is on
**ITEM** property
'itemdatabound event is automatically looping through the grid
Dim objRow As DataRowView = CType(e.Item.DataItem,
DataRowView)
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
Dim startDate As String = objRow("StartDate")
Dim endDate As String = objRow("EndDate")
Dim description As boolean= objRow("description")
If endDate.IndexOf("1/1/1900") >= 0 Then
e.Item.Cells(5).Text = ""
End If
If startDate.IndexOf("1/1/1900") >= 0 Then
e.Item.Cells(4).Text = ""
End If
' I AM STUCK HERE, I WANT THE HTMLNEWLINE FUNCTION TO RUN
THROUGH EACH ROW OF THE DESCRIPTION COLUMN.
'If description.TrueString Then
' Me.sqlStmts.HTMLEncodeNewLine(e.Item.Cells(2).Text)
'End If
End If
End Sub
Here are some of the errors I'm getting:
Cast from string " Banner Health selected Learnsof" to type 'Boolean'
is not valid.
I have a question
I have a grid
it is spitting this out
description
-----------
test1
test2
test3
I want to change it so that on ItemDataBound each row/value of
description column runs through a string function I pass it.
How do I do that?
here is my code so far:
Private Sub grdReadingNews_ItemDataBound(ByVal sender As Object, ByVal
e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
grdReadingNews.ItemDataBound
' below determines the column of the row that one should check
for (dataRowView)
'cint(e.item.itemIndex) is the actual row that it is on
**ITEM** property
'itemdatabound event is automatically looping through the grid
Dim objRow As DataRowView = CType(e.Item.DataItem,
DataRowView)
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
Dim startDate As String = objRow("StartDate")
Dim endDate As String = objRow("EndDate")
Dim description As boolean= objRow("description")
If endDate.IndexOf("1/1/1900") >= 0 Then
e.Item.Cells(5).Text = ""
End If
If startDate.IndexOf("1/1/1900") >= 0 Then
e.Item.Cells(4).Text = ""
End If
' I AM STUCK HERE, I WANT THE HTMLNEWLINE FUNCTION TO RUN
THROUGH EACH ROW OF THE DESCRIPTION COLUMN.
'If description.TrueString Then
' Me.sqlStmts.HTMLEncodeNewLine(e.Item.Cells(2).Text)
'End If
End If
End Sub
Here are some of the errors I'm getting:
Cast from string " Banner Health selected Learnsof" to type 'Boolean'
is not valid.