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?
Hi,
You are correct. Setting the EditorComponent on the column will apply to all of the cells in that column. If you have different buttons in each cell, you need to set the EditorComponent property on the cell, not the column.
The ideal place to do this is the InitializeRow event.
If you are doing this and you are having trouble getting the buttons to display, then the most obvious reason for that is that your column is not able to enter edit mode. The cell must be editable in order to show buttons. If it's an unbound column, then my guess is that you are disabling editing in the entire grid using the AllowUpdate property on the grid. In which case, the solution is to leave AllowUpdate at the default setting and then use the column.CellActivation property to disable each individual column except the button column.
My concern with this method is that it will only allow me to show the same buttons in every cell in that column. I need to control which buttons display at a row level, so I'm looking to put this code in the InitializeRow() event handler.
I did try the code above though and still didn't see the button show up in the grid on band 0 (I have 5 or 6 bands, but applied the editor only to band 0 just as a test. I can't see what setting might be causing the buttons to not be visible.
Use the InitializeLayout event, and reference the column.
Dim editor1 As New UltraTextEditor Dim button1 As New EditorButton button1.Appearance.Image = My.Resources.lock editor1.ButtonsLeft.Add(button1) ultraGrid1.DisplayLayout.Bands(0).Columns("images").Row.Cells("images").EditorComponent = editor1
Forgive any mistake in my VB syntax, I've spent the last 5 years in C# land.