Syncfusion GridControl Textbox - Restrict from pasting of the character more than maxlength

Syncfusion GridControl  Textbox Celltype

Restrict from pasting of the character more than maxlength


 Private Sub GridControl1_CurrentCellValidateString(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridCurrentCellValidateStringEventArgs) Handles GridControl1.CurrentCellValidateString

        If (e.Text.Length > GridControl1.ColStyles(1).MaxLength) Then
            e.Cancel = True
        End If

 End Sub


Private Sub GridControl1_PasteCellText(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridPasteCellTextEventArgs) Handles GridControl1.PasteCellText

        If (e.Text.Length > e.Style.MaxLength) Then
            e.Cancel = True
            e.Abort = False
        End If

    End Sub

Comments

Popular posts from this blog

Shared / Static Class in vb.net/C#

Xamarin Forms : PopUp Page with RG.Plugins.Popup

Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard)