Hello,
I have a windows application with an UltraGrid. I there is a Grid_ClickCell event that made some work.
I got the task to enable that to use all the selected rows, so user select multiple rows and I need to run that code for all the selected rows,
Grid_ClickCell (ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.ClickCellEventArgs) Handles Grid.ClickCell
I tried to isolate the code in the ClickCell in a function to call it from the place I need, but I am getting different problems, so now I am trying to call the Grid_ClickCell in a loop for the selected rows. What would be the best way to call it, do I call Grid_ClickCell it self, in that case, what object do I send as parameter e? Or is it a way to invoke the click for a cell in some other way such as row.Cells("Accept").Click*() for example?
Thank you
Thank you for your quick response. In this case I found the code causing the misbehavior when trying to move out the code from the event method and now it is working fine. The code giving me problems wasn't at the end Infragistic related but it was a subscribed routine.
Thank you for your quick response.
Hello Jose,
In general, I would recommend against calling methods that are acting as event handlers, but if you are going to try to call into this, you will need to create a ClickCellEventArgs object to pass to your Grid_ClickCell function as a parameter. There does not exist anything on the cells that will directly call into this method.
My best recommendation that I have in this case is if you are going to be using the code that is within your Grid_ClickCell method from multiple places, why not move that code out to another method that you can call from within Grid_ClickCell when it fires as well as from the current operation that you are trying to do? It appears that the only public property on the ClickCellEventArgs class is the Cell that was clicked which, if you need to pass a Cell, would be an operation that you could do externally if you have the row that owns that cell, and so I’m not sure what else you would potentially have in this method that would prevent you from doing this?
Please let me know if you have any other questions or concerns on this matter.