I have an UltraGridColumnChooser with the click event handler associated with designer interface of visual studio.
But when i execute code, the event never seem to fire, this also happens with all the other events of the UltraGridColumnChooser events.
How can i solve my problem?
Hello,
If my answer worked, could you verify it so other users having the same issue will find it more quickly?
hi,
i tried to modify the project using your instructions, now that works fine for me.
However in my opinion ultragridcolumnchooser could be updated in the future to works better with events, i think this is only a work around to solve the problem.
thank you anyway for the effort
Best Regards
The Development team told me that the UltraGridColumnChooser is functioning as designed. Here is what they told me.
The ColumnChooser control is a composite control. It's like a UserControl which contains other controls. It is therefore the controls inside the ColumnChooser which are receiving the mouse click and firing the appropriate events.
So if you really want to hook the mouse events, you have to hook the events on the contained controls within the ColumnChooser, not on the ColumnChooser itself.
public Form1() { InitializeComponent();
foreach (Control control in this.ultraGridColumnChooser1.Controls) { control.MouseUp += new MouseEventHandler(control_MouseUp); control.MouseDown += new MouseEventHandler(control_MouseDown); control.MouseClick += new MouseEventHandler(control_MouseClick); control.Click += new EventHandler(control_Click); } }
void control_Click(object sender, EventArgs e) { Debug.WriteLine("I've been clicked!!"); }
void control_MouseClick(object sender, MouseEventArgs e) { Debug.WriteLine("I've been mouse-clicked!!"); }
void control_MouseDown(object sender, MouseEventArgs e) { Debug.WriteLine("I've been mouse-downed!!"); }
void control_MouseUp(object sender, MouseEventArgs e) { Debug.WriteLine("I've been mouse-upped!!"); }
Please let me know if modifying your project to work like this resolves the issue.
I have logged this as a development issue.
Thank you Mike for the answer.... however I already found a solution, using events of other controls, that circumvents the problem and adapts to the purpose.
best regards