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
4040
Two events : button click and row selection
posted

Hi,

We have a Xamgrid with several columns. First contains an "Edit" button.

We would like the following behavior :

      case 1 - click on "normal" (text) cell : launch data loading

      case 2 - click on "Edit" button :

                      a - launch data loading

                      b - switch to edit mode (not in the grid, this is some of our code)

In case 1, no problem as only one event is firered on row selection (ex : SelectedRowsCollectionChanged).


But in case 2, two events are fired :

          - First the one for row selection,

          - and then the button click

These two events are independent (not synchronized). So depending on how long takes first one to finish (loading some data), the second event can fire before the other one finish or not.

Is there a way for us to  synchronize these events ?

By the way if during case 2, the focus is moved out of button, click event is not firered.....


Regards.

Alain.

 

Parents
No Data
Reply
  • 4475
    posted

    Hello,

     

    Thank you for your answer and for your sample, I now see your requirements better.

     

    On question part A:

     

    As far as I understand you need your RIA request to be finished with result delivered, before your click event rises. This issue is caused by the fact that by design all service calls in Silverlight work asynchronously. Many topics are being written according that matter. Here are two of them, people that are discussing inside this forums have similar issues to yours:

    http://forums.silverlight.net/t/164774.aspx/1
    http://stackoverflow.com/questions/6707704/silverlight-ria-services-with-synchronous-request

    Nevertheless the behavior of our xamGrid is expected - the execution of the first method continues after the RIA call, and then it has finished, the second handler has being invoked. However the RIA service can be still processing and this is designed to be so, ever since Silverlight 4. Workarounds of this Microsoft architecture decision are discussed all over the Internet.

     

    As to your question B:

     

    Our grid deals with its building controls focus via the edit mode. Usually the no-editable cells, like all the cells that you have, are not meant for interaction and this is why when you change the active item, the loadData method can easily moves the focus to another element. In such cases the focus should be carefully  controlled. I am not completely sure how this is relevant to the busy indicator you have used, so I was wondering if you could please elaborate on your sample

     

     I will be looking forward to hearing from you.

     

    Sincerely,

    Ekaterina

    Developer Support Engineer

    Infragistics, Inc.

    www.infragistics.com/support

     

Children