我在InitializeLayout事件中将用户控件关联为UltraWinGrid的Editor控件。 我正在尝试的是在我查找单元格值时检索编辑器控件实例。
答案 0 :(得分: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