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
1530
Removing selected item from datasource causes automatic activation of another record w/o setting new selected item
posted

HI there!

I read the other thread related to activation and selection but found no information that solves my problem.

How do I add the activated record to list of SelectedItems.Records?

In my szenario a record A is selected and is active.

Now this record gets deleted in the grids datasoure. The grid now deletes this row correctly and activates the row of record B.

How do i get this record B a selected record????

In event RecordActivated e.Record I get record B. But the SelectedItems.Records still contains thedeleted record A. SelectedItemsChanged will not be fired.

For a single selection it would be ok, if I just clear the SelectedItems.Records and Add the acivated record B.

In case of multiselection, I can't do this because the operation of multiselection will break.

Szenario: I have records A to C and a is selected.
When performing a multiselection, holding down the SHIFT key and clicking on record C, RecordActivated gets fired and e.Record is record C. But SelectedItems.Records do not contain the whole new selection (A to C), just the old one A.

In this case I can't clear the SelectedItems and add C.

SelectedItemsChanged will be fired afterwards containing the new selection.

 

How can I solve this problem? How do I get the new selection for the new active record if the active record changed is initiated by the grid itself?

By the way: why does the SelectedItems.Records contains records, when the datasource is complete empty?

Best regards

cew3

  • 27093
    posted

    Hello cew3,

    I am just checking if you got this worked out or you still require any assistance or clarification on the matter.

  • 27093
    posted

    Hello cew3,

    I have been looking into your issue and I was able to reproduce it to the letter except that in the test sample I created the deleted record also disappeared from the SelectedItems.Records collection. Would you please let me know which version of NetAdvantage are you using so I can continue with my investigation.

    Looking forward to hearing from you.

     

  • 490
    posted

    Hi,

    I am facing the same problem with xamdatagrid. I wan't to disable the automatic row activation after deletion of a dataitem from datasource. Please note that I have to show RecordSelector as well as to allow multiple selections in the grid.
    Waiting for a quick response.

    Regards,
    Nazish Kanwal