ciao a tutti ho questa classe:
Public Class StatoRichiesta
Private _isConfermata As Boolean = False
Private _isScaduta As Boolean = False
Private _isAnnullata As Boolean = False
Private _isConclusa As Boolean = False
Public Sub New()
End Sub
Public Property IsAnnullata() As Boolean
Get
Return _isAnnullata
End Get
Set(ByVal value As Boolean)
_isAnnullata = value
End Set
End Property
Public Property IsConclusa() As Boolean
Get
Return _isConclusa
End Get
Set(ByVal value As Boolean)
_isConclusa = value
End Set
End Property
Public Property IsConfermata() As Boolean
Get
Return _isConfermata
End Get
Set(ByVal value As Boolean)
_isConfermata = value
End Set
End Property
Public Property IsScaduta() As Boolean
Get
Return _isScaduta
End Get
Set(ByVal value As Boolean)
_isScaduta = value
End Set
End Property
End Class
vorrei generare una lista di elementi che compongono la classe in modo da renderla estensibile e bindabile tramite object datasource
in modo da trasformare questo codice che uso per leggere una checkboxlist
Dim st As New StatoRichiesta
For Each ckb As ListItem In ckbStatoRichiesta.Items
Select Case ckb.Text
Case "Annullata"
If (ckb.Selected) Then
st.IsAnnullata = True
End If
Case "InLavorazione"
If (ckb.Selected) Then
st.IsConfermata = True
End If
Case "Scaduta"
If (ckb.Selected) Then
st.IsScaduta = True
End If
Case "Completata"
If (ckb.Selected) Then
st.IsConclusa = True
End If
End Select
Next[/code]
in qualcosa tipo:
For Each ckb As ListItem In ckbStatoRichiesta.Items
if ckb.text= StatoRichiesta.Nome
If (ckb.Selected) Then
st.stato= True
End If
end if
next