bmgarver
(Brian Garver)
December 13, 2019, 2:36pm
1
I have added Spin buttons to an UltraGridColumn and need to capture the click event on those buttons, but have had no luck. The ClickCellButton event for the UltraGrid does not trigger when clicking a Spin button. Anyone know what click event on what control I should be looking for? Code below…
private void grdConnections_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs args)
{
UltraGridColumn angleColumn = args.Layout.Bands[0].Columns["Angle_c"];
angleColumn.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.IntegerWithSpin;
angleColumn.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
angleColumn.MinValue = 0;
angleColumn.MaxValue = 360;
EditorWithMask angleEditor = (EditorWithMask)angleColumn.Editor;
angleEditor.SpinIncrement = 5;
angleEditor.SpinWrap = true;
}
Alex
(Alex Villalon)
December 13, 2019, 7:16pm
2
Base on your explanation you will have to create your own even like when you use an standard control from epicor that you create the event on initialize code. You will have to create your own event.
bmgarver
(Brian Garver)
December 13, 2019, 7:56pm
3
Was able to figure it out. See below for posterity…
public class Script
{
private UltraNumericEditor invertEditor;
}
public void InitializeCustomCode()
{
this.invertEditor = new UltraNumericEditor();
this.invertEditor.EditorSpinButtonClick += new Infragistics.Win.UltraWinEditors.SpinButtonClickEventHandler(this.SpinButtonEvent);
}
private void grdConnections_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs args)
{
UltraGridColumn angleColumn = args.Layout.Bands[0].Columns["Angle_c"];
this.angleEditor.ButtonsRight.Add(new Infragistics.Win.UltraWinEditors.SpinEditorButton());
angleColumn.EditorControl = this.angleEditor;
angleColumn.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
}
private void SpinButtonEvent(object sender, Infragistics.Win.UltraWinEditors.SpinButtonClickEventArgs args)
{
//your code here
}