Hi Fergus,
Thanks much. That's exactly what i was looking for. It works !!
I have one more question:
i want to traverse the whole list using Items collection and check each
item with checkstate and do something based on their state. Can I still use
DataRowView?
How do I use CheckState? from which object?
I tried ..
For i = 0 To chklstTasks.Items.Count - 1
drvTask = CType(chklstTasks.Items(i), DataRowView)
' i want to do something like this ..
selec case drvTask.CheckState
case 'unchecked
case ' checked
case ' intermediate
end select
Next
thanks again.
"Fergus Cooney" <wo****@tesco.net> wrote in message
news:#x**************@TK2MSFTNGP10.phx.gbl...
Hi Mike,
chklstTasks.Items contains the list of ALL the items in the list,
while chklstTasks.CheckedItems contains ONLY those which have been checked. So
your first task (get all the checked items) is done for you.
Each of the items in chklstTasks.CheckedItems is a DataRowView,
however it is stored as an Object type. So you'll need to assign each one to a
DataRowView in order to access it.
Then it's familiar stuff.
Dim drvTask As DataRowView
Dim sInfo As String
For I = 0 To chklstTasks.CheckedItems.Count - 1
drvTask = chklstTasks.CheckedItems (I)
sInfo = drvTask ("header") & ", " & drvTask ("task_id")
'Do something with sInfo
Next
Best wishes,
Fergus