Hi, will try to make this short and clear!
(1) I have a list control which is populated by strings as follows
(leaving out declarations, etc., for brevity):
Dim strListItem As String = "GRN: " & UCase(txtGRN.Text) & " -- PN: " &
UCase(txtPartNo.Text)
If Trim(txtPartNo.Text) = "" Then
Exit Sub
End If
If Trim(txtGRN.Text) = "" Then
Exit Sub
End If
lItem = Me.lstPartNumbers.Items.FindByText(strListItem)
If lItem Is Nothing Then
Me.lstPartNumbers.Items.Add(New ListItem(strListItem))
(2) I have a simple datagrid containing the "parts" to be entered via
the above text boxes (txtGRN and txtPartNo).
As each strListItem is entered, I would like to rebind the parts
datagrid, coloring each row added to the list control grey, to indicate
this part has been entered.
I have the basic code for the formatting:
Sub SetRowColor(ByVal sender As Object, ByVal e As
DataGridItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem Then
'Check to see if the part string is in the list,
???
End Sub
...but can't quite figure out how to examine each row to see if the
PartNo is contained in the list control items. Each list item being a
concatenated string of two fields txtGRN and txtPartNo. I was thinking
InStr of some sort, but now getting lost. Below is the basic code I dug
up, any help to finish would be appreciated, as always.
Thanks,
Kathy
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!