Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
UltraWinGrid Problem with AfterRowActivate event Triggering
posted

Hi!

I have a query on firing of ultragrid AfterRowActivate event:

Description:

I have a Infragistics tree control where when you click on any of the nodes, we query the DB and load the adjacent lying ultrawingrid with the db returned datatable.

so, in the Tree_Select event, i have the code where we assign the data source to the ultrawingrid.

In the normal flow, in tree select event - we assign the data source and then after executing some code logic, it reaches onPaint() event of the grid which ultimately triggers the grid'd afterrowactivate event.

In a special case, where the user is trying to first click(mouse down) on any one of the tree node and without releasing the mouse button, immediately, drags the pointer to some other node in the tree (say the next node)  and releases the mouse button there, the flow goes like this:

On mouse down of the first node n1, it triggers the Tree_Select event where we assign the appropriate data source to the grid but before it could reach the AfterRowActivate event of the grid, it again hits the Tree_Select event , this time for the node on which the mouse was released (say n2).

Now, in this event, as soon as it executes the code where we assign the datasource for the grid, it triggers the AfterRowActivate event of the grid(it doesnot go thru the normal process of going thru the next set of stmts. and OnPaint() event to trigger the AfterRowActivate event). This is causing some undesired behavior. Upon closer look, found that it actually triggers the AfterRowActivate event with the data for node n1, executes it and then again hits it with the data for the desired node n2.

I want to prevent the first AfterRowActivate event from getting fired but am not able to achieve that.

My findings:

- I tried to first set the data source as null and then assign the datasource from DB returned DataTable but got same behavior.

Please help to achieve this. From browsing through the forum i came to know that whenever we change the activerow, AfterRowActivate should fire. So, it makes sense to me that it gets fired upon OnPaint() event, but how can i prevent it for the above mentioned case where we are assigning the data source.

Awaiting your valuable suggestions,

Thanks,

Ron