P
Paul Mason
Hi folks,
I am aiming to create a "select" column that is unbound on datagrid whose
other columns are all data bound. The idea is to let the user select items
to be printed etc.
The problem I have arises when I want to find out which rows are selected.
The following code is a tester that puts values into a string to be
displayed, but it's representative.
Dim chk As CheckBox
Dim itm As DataGridItem
Dim str As String
For Each itm In Me.dgVialList.Items
chk = CType(itm.Cells(0).Controls(0), CheckBox)
If chk.Checked Then
str += itm.Cells(1).Text & ", "
End If
Next
The problem occurs at chk = CType(itm.Cells(0).Controls(0), CheckBox) where
it says that it cannot cast the item as a checkbox. This collection is base
0?? I have only one template control (ItemTemplate).
Any ideas?
Cheers...P
I am aiming to create a "select" column that is unbound on datagrid whose
other columns are all data bound. The idea is to let the user select items
to be printed etc.
The problem I have arises when I want to find out which rows are selected.
The following code is a tester that puts values into a string to be
displayed, but it's representative.
Dim chk As CheckBox
Dim itm As DataGridItem
Dim str As String
For Each itm In Me.dgVialList.Items
chk = CType(itm.Cells(0).Controls(0), CheckBox)
If chk.Checked Then
str += itm.Cells(1).Text & ", "
End If
Next
The problem occurs at chk = CType(itm.Cells(0).Controls(0), CheckBox) where
it says that it cannot cast the item as a checkbox. This collection is base
0?? I have only one template control (ItemTemplate).
Any ideas?
Cheers...P