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
100
UltratextEditor in grid column
posted

I'm need to have two buttons in one cell of a ultraWinGrid.  I've achieved this by dynamically created an UltraTextEditor Control and adding two EditorButtons to the UltraTextEditor.  This is the code I use to achieve that.

Private Sub grdBudget_InitializeLayout(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles grdBudget.InitializeLayout

        Dim updateCellWidth As Integer = grdBudget.DisplayLayout.Bands(0).Columns("Update").Width
        Dim UTE As New Infragistics.Win.UltraWinEditors.UltraTextEditor
        UTE.Controls.Clear()
        Dim button1 As New Infragistics.Win.UltraWinEditors.EditorButton
        button1.ButtonStyle = UIElementButtonStyle.Button3D
        button1.Text = "Update"
        button1.Width = updateCellWidth / 2

        Dim button2 As New Infragistics.Win.UltraWinEditors.EditorButton
        button2.ButtonStyle = UIElementButtonStyle.Button3D
        button2.Text = "Save"
        button2.Width = updateCellWidth / 2

        UTE.ButtonsLeft.Add(button1)
        UTE.ButtonsLeft.Add(button2)
        AddHandler button1.Click, AddressOf button1_Click
        AddHandler button2.Click, AddressOf button2_Click
        AddHandler UTE.Click, AddressOf UTEClick

        grdBudget.DisplayLayout.Bands(0).Columns("Update").EditorControl = UTE
        grdBudget.DisplayLayout.Bands(0).Columns("Update").ButtonDisplayStyle = UltraWinGrid.ButtonDisplayStyle.Always
        grdBudget.DisplayLayout.Bands(0).Columns("Update").CellActivation = Activation.ActivateOnly
    End Sub

 

At the end I add event handlers to the buttons and the UltraTextEditor itself.  When I mouse any cell with the UltraTextEditor I see a yellow box move over the entire cell.  When I click that yellow box it disappears and I can click the buttons on the UltraTextEditor.  When I click these buttons the events that I added are not triggered.  However if at design time I add an UltraTextEditor and add the handlers in the same fashion I am doing with the dynamic UltraTextEditor, the events will trigger. Why can I not capture the events of this UltraTextEditor in the grid? Please help.

  • 469350
    Verified Answer
    Offline posted

    The "yellow box" sounds like a tooltip. The tooltip will display when the text in the cell doesn't completely fit. There were some old versions of the grid where tooltips were showing up at the wrong time. Make sure you have the latest Hot Fix. 

    Regarding the events, you can't hook the events of the button directly. You need to trap the EditorButtonClick event of the UltraTextEditor control itself. This is probably what you are doing at design-time and why it works - since you can't possibly access the events of the individual buttons at design-time.