Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
Cant make an UltraDropDown in a grid cell ...
posted

I've been searching near and far through the web to fin a working exemple of how to set an ultradropdown in a grid cell ... and everything I've found seems very basic ... and yet I cant make it work ... could anyone point me the error ?

My datatable seems correct, and in debug mode I can set the tooltiptext correctly (at the end of my "CreateUltraDropDown" section )

Yet, in the end, this cell is always empty. When I set en event in the initializeRow, I can see the valuelist is empty, but the valuelistResolved is filled with what seems to be my ultradropdown, but the cell is still always empty. This is driving me nuts, all the exemple I've seen don't have anything more ... what am I missing here ?


 Private Function CreateDataTableFromEnum(Of T)() As DataTable
        Dim dt As DataTable = New DataTable
        dt.Columns.Add("Display", GetType(String))
        dt.Columns.Add("EnumValue", GetType(Integer))
        dt.Columns.Add("Tooltip", GetType(String))

        For Each value As T In [Enum].GetValues(GetType(T))
            Dim desc As String = GetDescFromResx(value)
            Dim tt As String = GetToolTipFromResx(value)
            dt.Rows.Add(New Object() {desc, value, tt})
        Next
        dt.AcceptChanges()

        Return dt
    End Function

 Private Sub CreateUltraDropDown()

        dt = CreateDataTableFromEnum(Of TechniquesMinimum)()

        TechniqueMinDD = New UltraDropDown()
        TechniqueMinDD.SetDataBinding(dt, "")
        TechniqueMinDD.DisplayMember = "Display"
        TechniqueMinDD.ValueMember = "EnumValue"

        'TechniqueMinDD.Rows.Band.Columns("EnumValue").Hidden = True
        'TechniqueMinDD.Rows.Band.Columns("Tooltip").Hidden = True

        For x As Integer = 0 To (TechniqueMinDD.Rows.Count - 1)
            TechniqueMinDD.Rows.Item(x).ToolTipText = CStr(TechniqueMinDD.Rows.Item(x).Cells("ToolTip").Value)
        Next

End Sub

Private Sub UgCout_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles ugCout.InitializeLayout
        If IsNothing(TechniqueMinDD) Then CreateUltraDropDown()
        ugCout.DisplayLayout.Bands(0).Columns("TechniqueMinimum").ValueList = TechniqueMinDD
End Sub