Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can i detect DataGridView.SelectedRows pass in 2 for
Message
De
22/08/2011 01:01:11
 
 
À
20/08/2011 11:33:12
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
Divers
Thread ID:
01521317
Message ID:
01521459
Vues:
29
I already used .show but also can't to detect the before form DataGridView.SelectedRows method.
Actually, i tested more day. I think DataGridView.SelectedRows only can detect in current form.
So i give up it.
But i want to still finish this function. In this time, i think other method.
I only checked the DataGridView.SelectedRows in main form first, then user will leave the DataGridView,
i will store the rows index in array and pass to option form. After user chick the option form (OptionForm.show) and do something.

But i also some of technology problem. I don't know how can pass an array to other form store it and define a unknow array to pass , store.
The below is not finish code.
Anyone can give some of idea to me.....Thank you~~~
Public Class MainForm
  Public tempRowArray As ArrayList

    Private Sub AccessrightDataGridView_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles AccessrightDataGridView.Leave
        tempRowArray = New ArrayList
        tempRowArray.Clear()
        For Each r As DataGridViewRow In AccessrightDataGridView.SelectedRows
            tempRowArray.Add(r.Index)
        Next

        OptionForm.AccessRightPassRowNo = tempRowArray.Count      ' (error)my problem in this, i don't know how to pass the unknow array number in right method
        OptionForm.AccessRightPassRowArray = tempRowArray            '(error)my problem in this
    End Sub

    Private Sub BtnBatch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBatch.Click
        OptionForm.Show()    
    End Sub
---------------------------------------------------------------------------------------------------------------------------------------------------
Public Class BatchGrant
    Dim AccessRightPassRowsCount As Integer       ' (error)my problem in this, i don't know how to define the unknow array number in right method
    Dim AccessRightPassRows() As String               ' (error)my problem in this


    Private Sub BtnGrant_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnGrant.Click
        updateDatagridviewRecords()
    End Sub

    Public Sub updateDatagridviewRecords()
      '  For i = 0 To tempRowArray .Count - 1
       '     MainForm.AccessrightDataGridView.Rows(tempRowArray (i)).Cells(4).Value = CheckBoxCanass.Checked
       '     MainForm.AccessrightDataGridView.Rows(tempRowArray (i)).Cells(5).Value = CheckBoxCannew.Checked
       '     MainForm.AccessrightDataGridView.Rows(tempRowArray (i)).Cells(6).Value = CheckBoxcanmdy.Checked
       '     MainForm.AccessrightDataGridView.Rows(tempRowArray (i)).Cells(7).Value = CheckBoxcandel.Checked
       '     MainForm.AccessrightDataGridView.Rows(tempRowArray (i)).Cells(8).Value = CheckBoxcanprn.Checked
       '     MainForm.AccessrightDataGridView.Rows(tempRowArray (i)).Cells(9).Value = CheckBoxcanhld.Checked
       '     MainForm.AccessrightDataGridView.Rows(tempRowArray (i)).Cells(10).Value = CheckBoxcanuhd.Checked
       '     MainForm.AccessrightDataGridView.Rows(tempRowArray (i)).Cells(11).Value = CheckBoxviewcost.Checked
       '     MainForm.AccessrightDataGridView.Rows(tempRowArray (i)).Cells(12).Value = CheckBoxViewprice.Checked
        '    MainForm.AccessrightDataGridView.Rows(tempRowArray (i)).Cells(13).Value = CheckBoxCanexp.Checked
        'Next
    End Sub

    Public Property AccessRightPassRowNo() As Integer       ' (error)my problem in this, i don't know how to pass and store the unknow array number in right method
        Get                                                                           ' (error)
            Return Me.AccessRightPassRowsCount                  ' (error)
        End Get                                                                     ' (error)
        Set(ByVal value As Integer)                                         ' (error)
            Me.AccessRightPassRowsCount = value                  ' (error)
        End Set                                                                      ' (error)
    End Property                                                                   ' (error)

    Public Property AccessRightPassRowArray() As String        ' (error)
        Get                                                                               ' (error)
            Return Me.AccessRightPassRows                               ' (error)
        End Get                                                                           ' (error)              
        Set(ByVal value(AccessRightPassRowsCount) As String)      ' (error)
            Me.AccessRightPassRows = value()                                 ' (error)
        End Set                                                                              ' (error)
    End Property                                                                           ' (error)
End Class
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform