views:

284

answers:

1

I am associating a user control as Editor control of UltraWinGrid in InitializeLayout event. What I am trying is to retrieve the Editor Controls instance when I am chaning cell value.

A: 

I know this is probably too late for you, but maybe will help someone else. I think you want to hook the BeforeCellActivate event of your grid. Here is a sample in VB.Net.

 Private Sub ugGrid_BeforeCellActivate(ByVal sender As Object, _
    ByVal e As Infragistics.Win.UltraWinGrid.CancelableCellEventArgs) _
    Handles ugGrid.BeforeCellActivate

'find out if this is the column you are looking for,
'in this case I want Column with Key = "UnitNumber"
'also in this case, my Editor is a Masked Editor
'and I want to put in a customized mask
    Select Case e.Cell.Column.Key
        Case "UnitNumber"
            Dim maskedEdit As UltraMaskedEdit = _
               DirectCast(e.Cell.EditorControl, UltraMaskedEdit)

            Dim newmask As String = GetRulesBasedMask( _
                 e.Cell.Row.ListObject, maskedEdit.InputMask)

            maskedEdit.InputMask = newmask

    End Select
End Sub
BPerreault