Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can i detect DataGridView.SelectedRows pass in 2 form?
Message
De
19/08/2011 03:47:15
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
How can i detect DataGridView.SelectedRows pass in 2 form?
Versions des environnements
Environment:
VB 9.0
Divers
Thread ID:
01521317
Message ID:
01521317
Vues:
109
Hi all ,
I use vb.net ,two form, button and datagridview . In main form, my datagridview has some of DataGridViewCheckBoxColumn (column type).
I want to click the button will show the option form, it has some of checkbox can relate the main form DataGridViewCheckBoxColumn .
If the user Selected the Rows in main form, and then show the option form to update all of DataGridView cell value.
But i write the below function , it can't detect the DataGridView.SelectedRows.,so break my for loop function. How can i do? Thank you !!!
'MainForm function
       
    Private Sub BtnBatch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBatch.Click
        BatchGrant.ShowDialog()
    End Sub

    Public Sub updateDatagridviewRecords()
        For Each r As DataGridViewRow In AccessrightDataGridView.SelectedRows                  'In this can't detect my seleted rows?
            r.Cells(4).Value = OptionForm.CheckBoxCanass.Checked
            r.Cells(5).Value = OptionForm.CheckBoxCannew.Checked
            r.Cells(6).Value = OptionForm.CheckBoxcanmdy.Checked
            r.Cells(7).Value = OptionForm.CheckBoxcandel.Checked
            r.Cells(8).Value = OptionForm.CheckBoxcanprn.Checked
            r.Cells(9).Value = OptionForm.CheckBoxcanhld.Checked
            r.Cells(10).Value = OptionForm.CheckBoxcanuhd.Checked
            r.Cells(11).Value = OptionForm.CheckBoxviewcost.Checked
            r.Cells(12).Value = OptionForm.CheckBoxViewprice.Checked
            r.Cells(13).Value = OptionForm.CheckBoxCanexp.Checked
        Next
    End Sub


'OptionForm

    Private Sub BtnGrant_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnGrant.Click
        MainForm.updateDatagridviewRecords()
    End Sub
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform