t4ure4n

Hello every body

I am developing an application where i am using DataGridview it has following data

Table : Roles
--_---------------------------
| Role | Primary | Secondary |
------------------------------

Role is string type column
Primary and Secondary are Boolean type columns (So they appear with a check box)

i want to record the change of value of "Primary" and "Secondary" columns.


That is I want to know if user checked or unchecked the value in any row in the last two columns



Re: Windows Forms Designer DataGeidView Problem

JustNabil

For intCount As Integer = 0 To YOURGRID.Rows.Count - 1

Dim chk1 As CheckBox = CType(YOURGRID.Rows(intCount).FindControl("YOUR_FIRST_CHECKBOX_ID"), CheckBox)

Dim chk2 As CheckBox = CType(YOURGRID.Rows(intCount).FindControl("YOUR_2ND_CHECKBOX_ID"), CheckBox)

If chk1.Checked Then

doyourprocessing()

End If

If chk2.Checked Then

doyourprocessing()

End If

Next

Hope that works for u

Kind Regards

Nabil Khalid

(P.S. Dont forget to accept as Answerer if you find it useful)






Re: Windows Forms Designer DataGeidView Problem

t4ure4n

thats what i am now looking to do but how do i actually figure out that the value in the cell has changed
coz i tried using cellvaluechanged, cellendedit etc events
when user changes the value of the cell but they seem to work only when i change the value of the cell in a row which is not currently selected





Re: Windows Forms Designer DataGeidView Problem

JustNabil

well could you please elabrate more what you are trying to achieve so that i may tell you some work around. Or could you just copy paste the exact code you are writing with your intentions

Regards

Nabil






Re: Windows Forms Designer DataGeidView Problem

t4ure4n

What i wanted to do is to capture the event when user changes the value in the two columns named "primary" and "secondary".

These two columns are of type boolean so they are shown as a check box.

Hope this helps





Re: Windows Forms Designer DataGeidView Problem

JustNabil

well it looks like you are asking for win forms if thats the case then i m really sorr y i have never worked on winforms n just web forms so what i can suggest u is it looks like check change doesnt post back to server in your case so you have to make your own logic to implement this as you may handle selectedrow and checkchanged events both in same manner to achive your goal

Regards

Nabil