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

Parents
  • 30
    posted

    Hooooo, ok ...

    If I force a value in my cell, I get the correct value displayed ...

    Private Sub UgCout_InitializeRow(ByVal sender As ObjectByVal e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgsHandles ugCout.InitializeRow
          e.Row.Cells().Item("TechniqueMinimum").Value = 1
    End Sub

    I must find why the dropdown can't be used ... it's stay empty, even when I enter "edit mode" ... the "dropdown" button that would allow this cell to act like a dropdown is never shown, and the user cant type any text in the cell either.

Reply Children
No Data