Click here to Skip to main content
15,902,299 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Questionhow to implement custom membership provider with unity Pin
luivis721-May-13 5:35
luivis721-May-13 5:35 
AnswerRe: how to implement custom membership provider with unity Pin
Richard MacCutchan21-May-13 6:21
mveRichard MacCutchan21-May-13 6:21 
GeneralRe: how to implement custom membership provider with unity Pin
luivis721-May-13 6:38
luivis721-May-13 6:38 
Questionsave my codes source Pin
Member 849546620-May-13 1:46
Member 849546620-May-13 1:46 
AnswerRe: save my codes source Pin
Richard MacCutchan20-May-13 3:08
mveRichard MacCutchan20-May-13 3:08 
AnswerRe: save my codes source Pin
Abhinav S24-May-13 1:24
Abhinav S24-May-13 1:24 
AnswerRe: save my codes source Pin
MaulikDusara26-May-13 18:15
MaulikDusara26-May-13 18:15 
Questionvalidating on custom datagridview column Pin
sh-a19-May-13 23:56
sh-a19-May-13 23:56 
hi i create a custom datagridviewtextboxcolumn inherits from my control (that it inherits form textbox by some feature . for example limit to numberonly)
in my custom column I overrides onvalidating to check entered numbers before moving to another cells

my code is here :
VB
Protected Overrides Sub OnValidating(e As CancelEventArgs)
    'valueisChanged = True
    'EditingControlValueChanged = True
    'Me.EditingControlDataGridView.NotifyCurrentCellDirty(True)
    'MyBase.OnValidating(e)
    If AllowNull = False Then
        If String.IsNullOrEmpty(Me.Text.Trim) = True Then
            e.Cancel = True
            ' show message that cell value can not be null
            MessageBox.Show("لطفاً اطلاعات را وارد نمائید", "ارزیابی اطلاعات", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
        Select Case InputType
            Case Inputs.NationalCode
                If ValidateNcode(Me.Text.Trim) = False Then
                    e.Cancel = True
                    'show message that nationalcode is not in correct format
                    MessageBox.Show("لطفاً کد ملی را بصورت صحیح وارد نمائید", "ارزیابی اطلاعات", MessageBoxButtons.OK, MessageBoxIcon.Error)
                End If
            Case Inputs.Numbers
                If AllowNegative = True Then
                    If ismatched(Me.Text.Trim, negshregex) = False Then
                        e.Cancel = True
                        'show message that integer number length limit to 15 and decimal numbers maximum length is 3 for example 123456789012345.123
                        MessageBox.Show("فرمت اعداد صحیح نمی باشد" & vbNewLine & "حداکثر طول اعداد صحیح 15 رقم" & vbNewLine & "و حداکثر طول اعداد اعشار سه رقم می باشد", "ارزیابی اطلاعات", MessageBoxButtons.OK, MessageBoxIcon.Error)
                    End If
                Else
                    If ismatched(Me.Text.Trim, shregex) = False Then
                        e.Cancel = True
                        'show message that integer number length limit to 15 and decimal numbers maximum length is 3 for example 123456789012345.123
                        MessageBox.Show("فرمت اعداد صحیح نمی باشد" & vbNewLine & "حداکثر طول اعداد صحیح 15 رقم" & vbNewLine & "و حداکثر طول اعداد اعشار سه رقم می باشد", "ارزیابی اطلاعات", MessageBoxButtons.OK, MessageBoxIcon.Error)
                    End If
                End If
            Case Inputs.Decimals
                If AllowNegative = True Then
                    If ismatched(Me.Text.Trim, negshregex) = False Then
                        e.Cancel = True
                        'show message that integer number length limit to 15 and decimal numbers maximum length is 3 for example 123456789012345.123
                        MessageBox.Show("فرمت اعداد صحیح نمی باشد" & vbNewLine & "حداکثر طول اعداد صحیح 15 رقم" & vbNewLine & "و حداکثر طول اعداد اعشار سه رقم می باشد", "ارزیابی اطلاعات", MessageBoxButtons.OK, MessageBoxIcon.Error)
                    End If
                Else
                    If ismatched(Me.Text.Trim, shregex) = False Then
                        'show message that integer number length limit to 15 and decimal numbers maximum length is 3 for example 123456789012345.123
                        e.Cancel = True
                        MessageBox.Show("فرمت اعداد صحیح نمی باشد" & vbNewLine & "حداکثر طول اعداد صحیح 15 رقم" & vbNewLine & "و حداکثر طول اعداد اعشار سه رقم می باشد", "ارزیابی اطلاعات", MessageBoxButtons.OK, MessageBoxIcon.Error)
                    End If
                End If
        End Select
    End If

End Sub


when my custom column is in editing mode and I click by mouse to another place or cell ,if value of cell not matched , validating fired and prevent to move to another cell until user correct entered data. but when I press ENTER or Tab , validating showing message 2 time and move to another cell and don't prevent move to another cells

why press enter or tab not calling validating event ?
sh-a

AnswerRe: validating on custom datagridview column Pin
sh-a22-May-13 4:27
sh-a22-May-13 4:27 
QuestionDialogBasics asin MFC. Pin
Bram van Kampen15-May-13 13:58
Bram van Kampen15-May-13 13:58 
AnswerRe: DialogBasics asin MFC. Pin
Richard MacCutchan15-May-13 22:10
mveRichard MacCutchan15-May-13 22:10 
GeneralRe: DialogBasics as in MFC. Pin
Bram van Kampen16-May-13 14:05
Bram van Kampen16-May-13 14:05 
GeneralRe: DialogBasics as in MFC. Pin
Richard MacCutchan16-May-13 21:07
mveRichard MacCutchan16-May-13 21:07 
GeneralRe: DialogBasics as in MFC. Pin
Bram van Kampen17-May-13 9:35
Bram van Kampen17-May-13 9:35 
GeneralRe: DialogBasics as in MFC. Pin
Richard MacCutchan17-May-13 22:45
mveRichard MacCutchan17-May-13 22:45 
QuestionI suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
M-Badger15-May-13 11:43
M-Badger15-May-13 11:43 
AnswerRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
Eddy Vluggen16-May-13 5:01
professionalEddy Vluggen16-May-13 5:01 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
M-Badger16-May-13 8:34
M-Badger16-May-13 8:34 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
Eddy Vluggen16-May-13 9:13
professionalEddy Vluggen16-May-13 9:13 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
M-Badger16-May-13 9:57
M-Badger16-May-13 9:57 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
Eddy Vluggen16-May-13 11:25
professionalEddy Vluggen16-May-13 11:25 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
M-Badger16-May-13 9:58
M-Badger16-May-13 9:58 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
Eddy Vluggen16-May-13 11:26
professionalEddy Vluggen16-May-13 11:26 
AnswerRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
jschell16-May-13 7:57
jschell16-May-13 7:57 
GeneralRe: I suspect there's a Pattern for This: Optional Parameters vs. Overloading Pin
M-Badger16-May-13 8:37
M-Badger16-May-13 8:37 

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.