I've attached a sample project that contains the issue at hand. When clicking on the dropdown, I'm expecting that a messagebox should pop up. Instead no event is firing. Please advise.
Hi,
You are using a DropDownEditorButton. The way this button works is that you assign it a Control and when the user clicks it, the control will display on a DropDown window.
If you want a button that you can respond to a click event, then you should use an EditorButton instead of an EditorDropDownButton. And in that case, you would handle the EditorButtonClick event on the UltraTextEditor control. You should not handle an event on the button itself.
Hi Mike,Thanks for the reply. I decided that the dropdown window will be sufficient. What's weird is I added a valuelist to a column for each of the rows but I'm still not seeing anything happen when the dropdown button is clicked. I'm pretty sure I've seen this work in the past. See attached.
What, exactly, are you trying to do here? You seem to be mixing up a bunch of different features that are unrelated and I think you might be overcomplicating this.
If you want a dropdown list in a cell, then you can simply attach a ValueList to that cell. This is not working in this sample because in addition to assigning a ValueList, you are setting the EditorControl on the column to an UltraTextEditor, which doesn't natively support valuelists.
A DropDownEditorButton allows you to drop down a CONTROL in a cell - not a ValueList. In your sample, nothing drops down because you never assigned a control to your DropDownEditorButton.
There is no connection between the DropDownEditorButton and a ValueList. They are two totally different things.
So if you want the ValueList, don't assign the EditorControl - you don't need it. If you want to dropdown a control, then use the DropDownEditorButton.Control property to give it a control to drop down. If you want both, you could use an UltraComboEditor instead of UltraTextEditor.
Hi Mike,Originally I'm not sure what I needed or what the end result would look like. Basically, I needed a way to show a summary of errors that occurred during an import without having to open the entire error report. After trying different scenarios (dropdown, separate window, etc), I think I've settled on utilizing the ToolTipManager to show the summary and an editor button to click on to open the entire report.
Anyway... For some reason the button isn't showing in the intended column in the attached sample project. What's interesting is on my production project, the button does show but the button click (UltraTextEditor1.EditorButtonClick) doesn't fire.
Can you help me understand why it's not showing and also possible reasons why the event isn't firing?
-Aaron
Hi Aaron,
In the sample you posted here, the InitializeRow event is not hooked up to the grid. So your code is never being hit, you are never assigning the EditorControl to the ErrorSummary column, and so there's no button.
So change
Private Sub ImportList_InitializeRow(sender As Object, e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs)
to
Private Sub ImportList_InitializeRow(sender As Object, e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) Handles ImportList.InitializeRow
Once I did that, the button displays, but clicking on it has no effect. Clicking on a button in a cell is a function of the editor, so the cell has to be in edit mode. Your cells cannot enter edit mode in this grid, because of this:
Me.ImportList.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect
So you have to allow this cell to enter edit mode. You could do something like this:
Me.ImportList.DisplayLayout.Bands(0).Columns("ErrorSummary").CellClickAction = UltraWinGrid.CellClickAction.Edit Me.ImportList.DisplayLayout.Bands(0).Columns("ErrorSummary").CellActivation = Activation.ActivateOnly
Hi Mike - thanks for your help with the event handler. Nice catch. I feel like such a n00b. The customer is not in love with the fact that it now selects the text before selecting the row. I'm curious, is the UltraTextEditor the only control that has a ButtonsRight collection?
Again, thanks for your help.
I found what I was looking for. In the InitializeRow event, I just changed the style of the cell to EditButton and Activation to NoEdit and changed the CellClickAction back to RowSelect and it works like a charm. Thanks again Mike!
e.Row.Cells("ErrorSummary").Style = ColumnStyle.EditButtone.Row.Cells("ErrorSummary").Activation = Activation.NoEdit
Me.ImportList.DisplayLayout.Override.CellClickAction = UltraWinGrid.CellClickAction.RowSelect