Note that there are some explanatory texts on larger screens.

plurals
  1. POPost MouseUp alteration of datagrid!
    primarykey
    data
    text
    <p>I have .NET CF app, with a form that contains a datagrid which I've bound to a BindingList using a solution derived mainly from this article: <a href="http://msdn.microsoft.com/en-us/library/aa480736.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa480736.aspx</a></p> <p>I've hooked it up so that when a column header is clicked, I get the HitTest information and check for the Type. If the Type is ColumnHeader, then I initiate a Sort on the underlying BindingList (Using code similar to the example in the link posted above) - which in turn, makes the DataGrid sort itself according to the Property of T that I have clicked. E.g. Description</p> <p>This works absolutely fine!</p> <p>The problem comes when I now click around my datagrid - Let's say I have two rows, after the sort is performed, no row is selected. I click a cell in row 1 and I have code that selects the whole row - this operations occurs and all is well. When I now click row 2, row 2 gets selected and all is well, grid still has my sort applied. If I now click row 1 again, my sorting gets reversed, but crucially, the "ApplySort" method is not actually being called. So what is happening? It only happens when I click row 1, the two rows in the grid effectively are reversed. On selecting row 2, it does not occur.</p> <p>Upon debugging, I can see that mousedown fires (which i have put a return; statement in) and then MouseUp fires, which does the HitTest and calls ApplySort if the columnheader has been clicked, which in this case it has not. I noticed that the change in sort occurs * AFTER * control has left the MouseUp event - so something, somewhere, seems to be altering my grid state after MouseDown/MouseUp have finished.</p> <p>Any ideas what event/action could be messing with my Grid? I basically want to know if I can suppress anything and everything else once I have called my ApplySort.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload