Hi,
Have created a user control, with two grids. Each grid has a column of checkbuttons that the user can select, I also have declared two arrays: arrayGroups and arrayMembers, as strings (size = 1). Now when I click the first button on the form the following method should run
The problem is that the arrays arrayGroup, and arrayMembers, loses all the data assigned to it when the method is finished executing, any suggestions on how to maintain the data long term.
Mike55
Have created a user control, with two grids. Each grid has a column of checkbuttons that the user can select, I also have declared two arrays: arrayGroups and arrayMembers, as strings (size = 1). Now when I click the first button on the form the following method should run
Code:
Public Function retrieveSelected(ByVal dgName As DataGrid, ByVal arrayName As String)
Dim rsc As MetaBuilders.WebControls.RowSelectorColumn = MetaBuilders.WebControls.RowSelectorColumn.FindColumn(dgName)
Dim selected As Integer
Dim selIndex As Integer
Dim person As TableCell
selected = 0
For Each selIndex In rsc.SelectedIndexes
selected = selected + 1
Next
If arrayName = "arrayMembers" Then
ReDim arrayMembers(selected)
ElseIf arrayName = "arrayGroups" Then
ReDim arrayGroups(selected)
End If
'Dim arraySelected(selected) As String
Dim position As Integer
position = 0
For Each selIndex In rsc.SelectedIndexes
person = dgMembers.Items(selIndex).Cells(1)
If arrayName = "arrayMembers" Then
arrayMembers(position) = person.Text
ElseIf arrayName = "arrayGroups" Then
arrayGroups(position) = person.Text
End If
'arraySelected(position) = person.Text
position = position + 1
Next
End Function
The problem is that the arrays arrayGroup, and arrayMembers, loses all the data assigned to it when the method is finished executing, any suggestions on how to maintain the data long term.
Mike55