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
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.
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!
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 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,
Brian Fallon said: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.
Actually, the ValueList has a ValueListDisplayStyle property you can use for this.
The only tricky part, though, is that the UltraComboEditor does not expose the ValueList it is using directly. But you can cheat by getting the ValueList from an item (as long as you have at least one item on the list).
this.ultraComboEditor1.Items[0].ValueList.DisplayStyle = Infragistics.Win.ValueListDisplayStyle.DisplayText;
Upon further investigation, it appears that the DisplayStyle on the ValueList affects the list as well as the edit area, so my suggestion here won't work. Sorry for the confusion.
However, the UltraCombo control does have the ability to display images on the list and not in the edit area using the EditAreaDisplayStyle property. So you might want to consider using the UltraCombo instead of UltraComboEditor.