Hi there,
I have a multi band gridm and in each band I have added an unbound column which is set up as a button. I have handled the CellButtonClick event in my code, but it never seems to fire. I have put breakpoints on the method and have yet to see it stop there.
Also, once I have the event working, how can I figure out which band the call was made from so that I may handle it accordingly?
I assume that you mean the ClickCellButton event. The only reason I can't think of why this wouldn't fire is that you're somehow unhooking the event, or that you're accidentally hooking the event to a different event handler that happens to have the same signature. You might want to look at the property grid and see that the event has the correct event handler, or if you're hooking it up at run-time, that you're not accidentally unhooking it.
As for how to handle the event:
private void ultraGrid1_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e){ UltraGridBand band = e.Cell.Band; UltraGridRow row = e.Cell.Row; // Do stuff}
-Matt
I'm not sure what you mean, by checking the properties grid to make sure I have it connected to the correct event handler. I have not changed any properties at all to do with this event. In fact I can't even find any. Can you please give me more details, and possibly some specifics of where I can find the properties that you mentioned to make sure they are set up properly.
Thanks, Shane
Shane,
The property grid has an Events icon, shaped like a lightning bolt, that allows you to see which event have been hooked at design-time. In VB, you can select the grid in the code-behind window through the combobox at the top-left, then drop down a list of events on the right combo; any events that have an event handler would also be bold. Of course, if you're using VB, then you would also have a 'handles' statement following your event handler function declaration, so you'd see that this is hooked up correctly.
These were only suggestions on ways that you can verify that the event is hooked up. I can't really think of any other reason why the event wouldn't fire, unless your column is somehow disabled; if you're able to see the button clicked through a change in appearance, then this isn't the case.