Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can i detect DataGridView.SelectedRows pass in 2 form?
Message
From
19/08/2011 03:47:15
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
How can i detect DataGridView.SelectedRows pass in 2 form?
Environment versions
Environment:
VB 9.0
Miscellaneous
Thread ID:
01521317
Message ID:
01521317
Views:
108
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
Next
Reply
Map
View

Click here to load this message in the networking platform