Vs 2005, VB.net, Datagridview1, cell column name is IsClosed and its a
checkbox. When I click on it to check it I need to be run a procedure to see
if it can stay checked if not I must cancel the mod and uncheck the box.
I'm trying to use the cellValidating event as follows
Me.Datagridview1.Rows(e.RowIndex).ErrorText = ""
If Datagridview1.Rows(e.RowIndex).IsNewRow Then Return
If Datagridview1.Columns(e.ColumnIndex).Name = "IsClosed" Then
'This should apply my validation only to the cell that was just changed, and
now I need to see if the newvalue of the checkbox was set to checked.
Question is how do I do that? I thought of
If e.formattedValue.tostring = "1"
BUT when I look at my e.formattedvalue in my locals as I step through the
code and stop on the line e.formattedvalue, I see that it has the value of
another column, so it looks like its not validating my cell isClose but
rather the cell name CompanyCode
End If
What's happening here and how do I do this type of validation?
Thanks for any help.
Bob