Hi Susmitha!
Thanks for your addendum but no, the problem persists.
Let me explain what I'm doing here:
1) The grid was set at design-mode - it's easier to set a lot of properties...
2) I created a collection to fill the fields
Private _Pages As New ObservableCollection(Of PDF_Pages2Sign)
Public Property Pages() As ObservableCollection(Of PDF_Pages2Sign)
Get
Return _Pages
End Get
Set(ByVal value As ObservableCollection(Of PDF_Pages2Sign))
_Pages = value
End Set
End Property
That collection see a new class of fields, as shown below:
Public Class PDF_Pages2Sign
Private _Pagina As Integer
Private _Vertical As Integer
Private _Horizontal As Integer
Private _Tipo As String
Public Property Pagina As Integer
Get
Return _Pagina
End Get
Set(ByVal value As Integer)
_Pagina = value
End Set
End Property
Public Property Horizontal As Integer
Get
Return _Horizontal
End Get
Set(ByVal value As Integer)
_Horizontal = value
End Set
End Property
Public Property Vertical As Integer
Get
Return _Vertical
End Get
Set(ByVal value As Integer)
_Vertical = value
End Set
End Property
Public Property Tipo As String
Get
Return _Tipo
End Get
Set(ByVal value As String)
_Tipo = value
End Set
End Property
Public Sub New(ByVal pg As Integer, ByVal hor As Integer, ByVal vert As Integer, ByVal Tp As String)
Me.Pagina = pg
Me.Horizontal = hor
Me.Vertical = vert
Me.Tipo = Tp
End Sub
End Class
3) As recommended, I put the Handler into NEW event
Public Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
AddHandler SignaturesGrid.AutoGeneratingColumn, AddressOf OnSignaturesGrid_AutoGeneratingColumn
End Sub
4) The "TIPO" field (COMBO type) is populated and the Renderer is set as recommended by documentation:
Dim TiposAssinaturas As New Dictionary(Of String, String)
TiposAssinaturas.Clear()
TiposAssinaturas.Add("T", "T")
TiposAssinaturas.Add("TL", "TL")
TiposAssinaturas.Add("Q", "Q")
TiposAssinaturas.Add("QL", "QL")
TiposAssinaturas.Add("M", "M")
TiposAssinaturas.Add("ML", "ML")
TryCast(Me.SignaturesGrid.Columns("Tipo"), Syncfusion.WinForms.DataGrid.GridComboBoxColumn).MappingName = "Tipo"
TryCast(Me.SignaturesGrid.Columns("Tipo"), Syncfusion.WinForms.DataGrid.GridComboBoxColumn).DataSource = New BindingSource(TiposAssinaturas, Nothing)
TryCast(Me.SignaturesGrid.Columns("Tipo"), Syncfusion.WinForms.DataGrid.GridComboBoxColumn).DisplayMember = "Key"
TryCast(Me.SignaturesGrid.Columns("Tipo"), Syncfusion.WinForms.DataGrid.GridComboBoxColumn).ValueMember = "Value"
Me.SignaturesGrid.CellRenderers.Remove("Tipo")
Me.SignaturesGrid.CellRenderers.Add("Tipo", New GridComboBoxCellRendererExt())
5) The datasource is populated during the processing
Dim Item As New PDF_Pages2Sign(Local_da_Assinatura_Pagina, Local_da_Assinatura_Coordenada_X, Local_da_Assinatura_Coordenada_Y, Setagem)
Pages.Add(Item)
SignaturesGrid.DataSource = Pages
(see topic 2 above for the definition of PDF_Pages2Sign
So, following the above code, everything functions 100%, except the "edition mask", which at the integers fields always shows 2 decimals. Even I setting the field to "{0:n0}" at design-mode (which will be expected to function) or either at runtime mode.
And I checked that even using the Handler at NEW event, the method is not called anyway.
It's really weird... :)
I appreciate your attention.
Kindest regards,
David