Validating datagridview cell in vb net

Posted by / 22-Aug-2016 16:06

Validating datagridview cell in vb net

In a datagridview (vs2005, VB.net) I have two columns that are checkboxes. I need to check that only one of the two can be checked. Net 2005, Unbound Data Grid Viewer with 2 (two) columns ("Check Num" Index 0; "Clear Date" Index 1). I tried MS's Help pages and oh, those are useful (heavy sarcasm). I would like to be able to validate the cells and force the user to put correct values in it. I need to check that only one of the two can be checked.

Private Sub dg Checks_Cell Validating(By Val sender As Object, By Val e As System. Cell Validating Dim Val Date As Date = Nothing Dim Val Long As Long = 0 If dg Checks. I could easily do this using Cell Value Changed but I don't want the user to be able to leave the cell if the zip Code is not valid. Thanks Perrin you may have to reference it through the sender obj that is passed. this may be the datagrid itself or the datagridviewrow, you will have to msgbox a sender. Then you can code directly against the sender, and that should work. Ticks --------------------------------------------------Bluto: What? Boon: Forget it, he's rolling.-------------------------------------------------- Well...

validating datagridview cell in vb net-1validating datagridview cell in vb net-3validating datagridview cell in vb net-54