We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Firing clicked event when user control with datboundgrid placed on form

I apologize if this is a windows question and not a true grid question, but in that case I still hope someone could guide me in the right direction. What I want to achieve is have a click on the ucGrid trigger other functions on the parent form. However, that is not possible at design time and I hence am trying to fire a clicked event and compare new record vs old record to see if an update on the parent form is required. (I made a user control because I want to use it on several forms). If I understand the order of events correctly there is one of two things at play. Windows will not trigger a clicked event on the ucGrid1 instance on the form (which is obvious since when clicking on the grid (which fills the entire uc form) the CurrentCellActivated event on the grid is triggered if the cell changes, if CurrentCellActivated is not defined it triggers the Clicked event on the Grid. However, nothing triggers on the uc Form or the parent form where an instance of the uc resides as ucGrid1. If not a windows issue this must have somthing to do with the implementation of the databound grid - I would think? Unfortunately I am not a Windows programming expert and will hence greatly appreciate any guidance from this group! I have thought of a button on the form for retrieving the dependent data. I could create a parent child relationship on the form directly, but that would invalidate my attempt to create reusable User Controls. Other thoughts are greatly welcomed! Thanks, Knut Vonheim

1 Reply

AD Administrator Syncfusion Team February 27, 2003 06:49 AM UTC

Can you add a new event to your user control to which your form can listen? You could fire this event at the points in the grid code (say maybe RowSaved) where you want to notify the form that something has changed in the usercontrol/grid. Then in the event handler for this event on your form, you can do whatever you need. You can use the event arguments to pass information to/from the user control to the event listener.

Loader.
Live Chat Icon For mobile
Up arrow icon