Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can i detect DataGridView.SelectedRows pass in 2 for
Message
De
19/08/2011 12:40:38
 
 
À
19/08/2011 12:26:14
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:
01521355
Vues:
31
Hi,

I just read Alex's post and it occurs to me that he may be expecting the act of checking the Checkbox to select the row ?

>SelectedRows should work.However, the user must select the rows such that the entire row is selected, not just one cell. First be sure that that is where your problem is. If entire rows are being selected and you still do not get anything in the SelectedRows collection, then there is another problem elsewhere.
>
>Could you verify this?
>
>~~Bonnie
>
>
>
>
>>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
>>
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform