Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys

so i'm in urgent need of a soloution, i got one column thats named monthly installment which is a integer column,then i got 2 more unbound columns that are checked box namely accounts and bond/car loan,i also got 2 labels namely label 5 and label 6,so what i want to do is let label 5 = to all accounts that is checkd and label 6 = to all bond/car loan from monthly installment

What I have tried:

For Each dr As DataGridViewRow In DataGridView1.Rows
If dr.Cells("Account").Value = True Then
Dim int1 As Integer = 0
int1 = Label5.Text
Dim int2 As Integer
int2 = DataGridView1.Item(2, DataGridView1.CurrentCell.RowIndex).Value
Label6.Text = int1 + 2
End If
Next
Posted
Updated 7-Jun-16 2:42am

1 solution

Hi,

Check this...

On GridView RowDataBound...

 If e.Row.RowType = DataControlRowType.DataRow Then

            Dim chkSelect As CheckBox = e.Row.FindControl("chkselect")
            Dim lbl_chkSelect As Label = e.Row.FindControl("lbl_chkSelect")

            If lbl_chkSelect.Text = "1" Then
                chkSelect.Checked = True
            Else
                chkSelect.Checked = False
            End If

End If


Hope this will help you.
Cheers
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900