xtragrid custom editor code example

Example: xtragrid custom editor

Dim spinEdit As New RepositoryItemSpinEdit()
Dim calcEdit As New RepositoryItemCalcEdit()
gridControl1.RepositoryItems.AddRange(New RepositoryItem() { spinEdit, calcEdit })
gridView.Columns("Length").ShowButtonMode = ShowButtonModeEnum.ShowAlways

' Handle this event to assign editors to individual cells
AddHandler gridView.CustomRowCellEdit, Sub(sender, e)
    Dim view As GridView = TryCast(sender, GridView)
    If e.Column.FieldName = "Length" Then
        Dim boolVal As Boolean = CBool(view.GetRowCellValue(e.RowHandle, "Mark"))
        If boolVal Then
            e.RepositoryItem = spinEdit
     Else
            e.RepositoryItem = calcEdit
     End If
    End If
End Sub