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
1465
How to add UltraNumericEditor
posted

Hello.

I am trying to create a tree where each node has an UltraNumericEditor column and a Label column. It's for "Quantity" and "Description", respectively. I'm having a hell of a time.

I am getting an error when adding the UltraNumericEditor.

Here's my code:

        uTreeOptions.ViewStyle = ViewStyle.FreeForm
        Dim rootColumns As New UltraTreeColumnSet()
        rootColumns.Columns.Add("Qty")
        rootColumns.Columns.Add("Description")
        For Each row As DataRow In _dtOptions.Rows
          Dim _key As String = row("ContractSequence").ToString.Trim()
          Dim childNode As UltraWinTree.UltraTreeNode = 
uTreeOptions.Nodes.Add()
          childNode.Override.ColumnSet = rootColumns
          childNode.Cells("Qty").Value = 0
          childNode.Cells("Qty").AllowEdit = AllowCellEdit.Full
          Dim wne As New UltraWinEditors.UltraNumericEditor()
          wne.Name = row("ContractSequence").ToString.Trim()
          wne.SpinButtonDisplayStyle = ButtonDisplayStyle.Always
          wne.MaxValue = 9
          wne.MinValue = 0
          wne.Nullable = False
          wne.MaskInput = "#"
          wne.MaskDisplayMode = UltraWinMaskedEdit.MaskMode.Raw
          wne.Value = 0
          childNode.Override.ColumnSet.Columns("Qty").EditorComponent = wne
childNode.Cells("Description").Value = row("WebNarrative1").ToString().Trim() & " - " & CDbl(row("Price")).ToString("C")

Next

Thanks in advance,
Mike
Parents
  • 469350
    Offline posted

    Hi Mike,

    What's the error and on what line of code does it occur?

    Also... this probably has nothing to do with the issue, but the code you have here is very inefficient. You are assigning the EditorComponent to the same ColumnSet every time you add a node. If you want every node to have the same structure, you only need to do this once. You also don't need to assign the ColumnSet to each individual node. And you should be using Grid style, not FreeForm.

Reply Children