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
2549
How to remove a row from XamDataPresenter
posted

Good morning,

I just started with the Infragistics WPF suite. While I use the Infragistics Windows Forms suite for quite a while now I stepped into a problem.

Here's the case:
I have a BindingList containing objects, nothing special.
That BindingList is bound to a xamDataPresenter using an ObjectDataProvider in XAML.

So far so good, records get displayed as expected.

Not there is a "remove" button that should remove a selected row.
How can I do this in code?
I already tried:

DataPresenterCommands

 

 

.DeleteSelectedDataRecords.Execute(null, dpOverview);
dpOverview.UpdateLayout();

...which does nothing, I casted the DataSource to a BindingList of correct type and removed the record there, not visible and even if I delete the item from the database I am not able to remove the corresponding row.

How can this be done in code? Any hints are kindly appreciated.

best regards
Andy

Parents
  • 2549
    posted

    ...a little update:

    I figured out why the DeleteSelectedDataRecords command didn't work. I set AllowDelete to true and now it works.

    Unfortunately there is now a little popup asking me if it is "ok" to delete the selected records.
    Actually I do not wan't to ask the users if it is ok for them, I just assume it is. So can this message be suppressed?

    I am wondering if this is the correct approach for this scenario. Is there a better way to remove records?
    And how do I get rid of the popup ;)

    best regards
    Andy

Reply Children