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.Ite ms.Count - 1
drvTask = CType(chklstTas ks.Items(i), DataRowView)
' i want to do something like this ..
selec case drvTask.CheckSt ate
case 'unchecked
case ' checked
case ' intermediate
end select
Next
thanks again.
"Fergus Cooney" <wo****@tesco.n et> wrote in message
news:#x******** ******@TK2MSFTN GP10.phx.gbl...
Hi Mike,
chklstTasks.Ite ms contains the list of ALL the items in the list,
while chklstTasks.Che ckedItems 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.Che ckedItems 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.Che ckedItems.Count - 1
drvTask = chklstTasks.Che ckedItems (I)
sInfo = drvTask ("header") & ", " & drvTask ("task_id")
'Do something with sInfo
Next
Best wishes,
Fergus