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
405
Adding multiple buttons to some cells in some bands of the grid...
posted

Ok... I've searched this topic and found a lot of posts on related tasks, but nothing seems to help me get the buttons showing up in my grid...

I'm using some combination of the following code in my InitializeRow event handler:

 Dim editor1 As New UltraTextEditor
 Dim button1 As New EditorButton
 button1.Appearance.Image = My.Resources.lock
 editor1.ButtonsLeft.Add(button1)
 e.Row.Cells("images").EditorComponent = editor1

This may be a terribly inefficient way to go about this, but I'm not concerned with that until I get the buttons to actually show up!  My desire is to get multiple buttons (3 to 5 max, but any combination of those 3 to 5 buttons can be in each cell).  I've got a "buttons" column in the grid... currently bound to a string column in the datatable but all values are empty.  I may make this an unbound column later but with the hierarchical nature of my grid, leaving it bound for now is easier. 

I can't find a combination of properties that makes the buttons visible.  Everything I've read says they should be showing up, but they are not.  I've seen grids that do this so I'm fairly sure it's possible. 

Any ideas on what I'm missing? 

Parents Reply
  • 405
    posted in reply to Mike Saltzman

    ok, here's a follow-up question... I have the buttons in and they look great... I've set the appearance of the EditorButton to use a transparent background color and I'm using the Office2007ScrollBarButton button style so they look almost just like images.  Here's a pic...

     

    So long as the mouse is not hovering over the cell that contains the images, they look great.  If I hover over that cell, however, I get a sort of hottrack on the editorbutton: 

    The EditorButton is applying a mouseover appearance setting and I can't find any way to override it.  Any ideas? Not the end of the world but I'd like to make it so that hovering over the cell or button doesn't visually change it.  However, I can't cancel the mouseenterelement event as I'm using that for tooltips on the editor buttons. 

    On an unrelated note... I'm having trouble reusing appearance objects on the EditorButtons.  To setup the appearance changes to the editorbutton, I'm using the following code every time I add a button to the editor that is assigned to the cell:
             If CBool(.GetCellValue("notes")) Then
                        editorbutton = New EditorButton
                        editorbutton.ButtonStyle = UIElementButtonStyle.Office2007ScrollbarButton
                        editorbutton.Appearance.BackColor = Color.Transparent
                        editorbutton.Appearance.Image = My.Resources.note
                        editorbutton.Tag = "One or more notes were found for this account."
                        textEditor.ButtonsLeft.Add(editorbutton)
             End If

    The part in bold is my problem... I've tried adding an appearance to the appearances collection of the grid and then assigning the appearance like this:  
                        editorbutton.Appearance = ugMeasures.DisplayLayout.Appearances("NotesImageNotesFound")

    This doesn't do anything.  The only way I've been able to apply appearance settings to the appearance of the EditorButton is to do it manually, which is not ideal.  I can deal with this though and do the cleanup, but if there's a way to do it the correct way (reusing appearance objects), I'd like to do it that way. 

    Thanks again for your help!

    Rocky

Children