Hey guys!
First off, thanks for your help in the past! Your info is always very enlightening.
I've attached an image that shows/explains what I am trying to do. Basically I want to add a button (ButtonsLeft.Add) left of a dropdownlist, but ONLY there, in one cell, in one row. Right now, the button gets added to every row in the band. (as you can see)
I'm thinking I need to draw everything on the cell. Kinda scary.
In addition, I had some other image-related questions... see attached.
Thanks!!
Don
UltraGridCell exposes Editor/EditorControl properties, so you can specify a different editor for a given cell, and populate the ButtonsLeft or ButtonsRight collection of that editor.
Regarding the image appearing in the list but not the edit portion: The ValueList class, which is what is responsible for showing the dropdown, does not support displaying the image in the list but not the edit portion. You can enter a feature request for this functionality if you like.
Thanks guys! I think I understand how to use the ButtonsLeft property, but I still can't seem to isolate my button to only one cell. I've attached some sample code that illustrates my point.
This code is pretty dumb, but bear in mind that at some point (likely in CellChange) I will be deciding whether to show the button based on some property of the selected combo item. In this sample, I'm just showing the button, regardless of which item is selected. Just fyi.
Thanks,
Hi Don,
The main problem with the code you have here is that you are using the EditorResolved on the column. The editor is shared, not just between cells in the same columns, but between all cells in the grid that use the same editor type. So this won't work.
What you need to do is create a NEW Editor or EditorControl and assign it to the cells that you want the button to show up on.
I recommend using the InitializeRow event for this.
Thanks Mike!
I was able to create a new EditorWithCombo for each of the cells in question, and did not need to make any other significant changes to my code... everything works great. :)
I did play around with your UltraCombo suggestion, but in the end I preferred the look of the EditorWithCombo. Any suggestions on how to replace my EditorWithCombo with an UltraCombo and keep a similar look and feel? Obviously the UltraCombo has a DataSource, not a ValueList.... and I was able to hide the column header for the UltraCombo list... any other tips?
Thanks again!
dcosler said:I was able to create a new EditorWithCombo for each of the cells in question
It's probably a good idea to create a single EditorWithCombo and use it for all the cells that need it. Creating a new one for every cell is not as efficient - if that matters.
dcosler said:Any suggestions on how to replace my EditorWithCombo with an UltraCombo and keep a similar look and feel? Obviously the UltraCombo has a DataSource, not a ValueList.... and I was able to hide the column header for the UltraCombo list... any other tips?
You would probably want to hide all but one column, so you could use the InitializeLayout event of the UltraCombo and set the hidden property on all but one of the columns.
And you can turn off row and cell borders using BorderStyleRow and BorderStyleCell.