2

我在 InitializeLayout 事件中将用户控件关联为 UltraWinGrid 的编辑器控件。我正在尝试的是在更改单元格值时检索编辑器控件实例。

4

1 回答 1

2

我知道这对您来说可能为时已晚,但也许会对其他人有所帮助。我认为您想挂钩网格的 BeforeCellActivate 事件。这是 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
于 2010-03-29T13:03:42.947 回答