Is there a way to capture when the Header gets clicked? When the "Text Here" is clicked I would like to perform an action. I have suggested adding Editor Button in the ButtonsRight but they would rather have it in the list like shown below.
Ideally they would like it at the bottom of the list as shown in this control but I am not sure that is possible.
Any other suggestions welcome.
I'm a bit confused by this screen shot. As far as I know, UltraCombo doesn't have a header. So I'm not sure what that element in the screen show actually is. You must be doing something to create that header. Like maybe it's a Group header and all of the columns are in the group. Or maybe it's something else. If you wanted an "add new" button at the bottom, then I think the best way to do that would be to add an extra row into your data source and then use a CreationFilter to replace the display of the row with a button or something like that.
You are correct. I was adding a Header
Dim bmt As Bitmap = CType(SuGlobal.SystemSettings.SelectImage(SuGlobal.Images.AddNew), Bitmap) UltraCombo1.DisplayLayout.Bands(0).Header.Caption = "Text Here" UltraCombo1.DisplayLayout.Bands(0).Groups.Band.Header.Appearance.Image = bmt
I haven't been able to get a "mouse up" event to fire when I click on the header. I am assuming there isn't anything that will fire that, correct? If not, I plan on going down the road of adding an extra row to my data source. I haven't played around with the creation filter for that extra row yet, but thanks for that idea.
Thanks,
Laura
Ah, so it's the band header. That makes sense. The tricky part of this is that the MouseUp probably only fires for the UltraCombo control's edit area and probably does not fire when you click on the dropdown grid. So there are two approaches you could take from here. One would be to try to get a reference to the dropdown control and hook the MouseUp of THAT control.
The second approach would be what I mentioned before where you have an extra row in the DataSource and use a CreationFilter to replace the entire last row with a button. Although... after giving this a bit more thought, it occurs to me that using a an actual data row might be a little tricky, because if the user sorts the rows, for example, the row would might get sorted to the wrong place. There are ways around that, but you might also need to deal with filtering and other functionality and that might be more trouble that it's worth. You might also be able to take a sort've hybrid approach and use a CreationFilter to replace the Band Header with a button.The first approach, of simply hooking the MouseUp (and I would recommend MouseUp instead of MouseDown) of the Band Header is probably the easiest approach - which is not to say that it will be easy, just easier. I whipped up a quick sample of that for your reference. Seems to work pretty well in an simple test app. Let us know if you have any questions. WindowsFormsApp72.zip
I hate to ask, but is there any way to get your sample in vb.net?
Hello Laura,
I am glad that you managed to resolve your issue.
Thank you for choosing Infragistics!
Regards,Ivan Kitanov
Thank you Mike and Ivan for your work. This is exactly what I needed!
Following the sample that Mike provided I have created a similar one in VB, you can find it attached below.
Please let us know if you need further assistance.
ComboEditorHeaderClick.zip