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?
What's the problem?
What are you trying to accomplish with the events of the UltraGridColumnChooser?
Are you using a ColumnChooser internal to the grid or creating your own?
Which events, exactly, do not fire?
My guess is that whatever you are doing, you will need to use events of the grid, but it's impossible for me to guess without knowing what you are trying to do.
Simply using Infragistics 10.1, i try to create a win form application with an ultragrid (ultraGrid1) bound to an ultradatasource of 3 columns.
In the same window i create an external ultragridcolumnchooser and setup the SourceGrid property to ultraGrid1 value. Then i create a Click event on ultragridcolumnchooser that simply show at run-time a message box as test application.
When i execute application and try to click on ultragridcolumnchooser no message box appeares.
I also try with MouseClick event and it doesn't work yet.
Hi,
I tried this out and I get the same results, the Click event does not fire. I'm not sure if this was done intentionally, but it seems like a bug to me, so I'm going to forward this thread over to Infragistics Developer Support so they can get it checked out.
In the mean time, if you can tell me what you are trying to do, and why you want to hook the Click event, maybe I can suggest an alternative.
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