Click here to Skip to main content
15,891,184 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generaldatagrid Pin
Paps24-Oct-04 5:25
Paps24-Oct-04 5:25 
GeneralRe: datagrid Pin
Dave Kreskowiak4-Oct-04 9:07
mveDave Kreskowiak4-Oct-04 9:07 
GeneralRe: datagrid Pin
Anonymous4-Oct-04 10:14
Anonymous4-Oct-04 10:14 
GeneralRe: datagrid Pin
Paps24-Oct-04 11:00
Paps24-Oct-04 11:00 
GeneralRe: datagrid Pin
Anonymous4-Oct-04 19:20
Anonymous4-Oct-04 19:20 
GeneralRe: datagrid Pin
Anonymous4-Oct-04 21:18
Anonymous4-Oct-04 21:18 
GeneralRe: datagrid Pin
Paps25-Oct-04 3:19
Paps25-Oct-04 3:19 
GeneralRe: datagrid Pin
Paps25-Oct-04 4:19
Paps25-Oct-04 4:19 
There is one tiny problem here.

I want to check if the value entered is 'Mr' or 'Mrs'
ElseIf CType(e.ProposedValue, String) <> "Mr" or CType(e.ProposedValue, String) <> "Mrs" Then
But when I enter Mr or Mrs it displays the error mssg.

But when I check the value individually it works fine:
ElseIf CType(e.ProposedValue, String) <> "Mr" Then

If (e.Column.ColumnName.Equals("Contact Title")) Then
' Do not allow it to be empty
If CType(e.ProposedValue, String) = String.Empty Then
Dim badValue As Object = e.ProposedValue
e.ProposedValue = "Bad Data"
e.Row.RowError = "The Contact Title column contians an error"
e.Row.SetColumnError(e.Column, "Contact Title cannot be Empty")
' Do not allow if the value is not 'Mr' or Mrs
ElseIf CType(e.ProposedValue, String) <> "Mr" Or CType(e.ProposedValue, String) <> "Mrs" Then
Dim badValue As Object = e.ProposedValue
e.ProposedValue = "This field is limited to'Mr','Mrs'"
e.Row.RowError = "The Contact Title column contians an error"
e.Row.SetColumnError(e.Column, "Contact Title cannot be Empty")
Else
e.Row.ClearErrors()
End If
End If
GeneralRe: datagrid Pin
Anonymous5-Oct-04 6:52
Anonymous5-Oct-04 6:52 
GeneralRe: datagrid Pin
Paps25-Oct-04 8:10
Paps25-Oct-04 8:10 
GeneralRe: datagrid Pin
Anonymous5-Oct-04 7:11
Anonymous5-Oct-04 7:11 
GeneralRe: datagrid Pin
Paps25-Oct-04 7:38
Paps25-Oct-04 7:38 
GeneralRe: datagrid Pin
Anonymous5-Oct-04 7:55
Anonymous5-Oct-04 7:55 
GeneralRe: datagrid Pin
Anonymous5-Oct-04 11:57
Anonymous5-Oct-04 11:57 
QuestionGetting all availabel information of a computer? Pin
dungle304-Oct-04 0:18
dungle304-Oct-04 0:18 
AnswerRe: Getting all availabel information of a computer? Pin
Dave Kreskowiak4-Oct-04 5:45
mveDave Kreskowiak4-Oct-04 5:45 
GeneralRe: Getting all availabel information of a computer? Pin
dungle305-Oct-04 22:10
dungle305-Oct-04 22:10 
GeneralRe: Getting all availabel information of a computer? Pin
Dave Kreskowiak6-Oct-04 13:13
mveDave Kreskowiak6-Oct-04 13:13 
GeneralRe: Getting all availabel information of a computer? Pin
dungle306-Oct-04 16:38
dungle306-Oct-04 16:38 
GeneralRe: Getting all availabel information of a computer? Pin
Dave Kreskowiak6-Oct-04 17:03
mveDave Kreskowiak6-Oct-04 17:03 
GeneralRe: Getting all availabel information of a computer? Pin
dungle307-Oct-04 18:27
dungle307-Oct-04 18:27 
GeneralRe: Getting all availabel information of a computer? Pin
Dave Kreskowiak8-Oct-04 4:30
mveDave Kreskowiak8-Oct-04 4:30 
GeneralRe: Getting all availabel information of a computer? Pin
dungle3010-Oct-04 19:12
dungle3010-Oct-04 19:12 
AnswerRe: Getting all availabel information of a computer? Pin
Anonymous4-Oct-04 22:23
Anonymous4-Oct-04 22:23 
GeneralReturn the value of cancel button Pin
Mekong River3-Oct-04 21:57
Mekong River3-Oct-04 21:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.