Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: MVVM (Ribbon) Crud Operations Problem

$
0
0
Hi there,

I used the Datagrid previously and successfully in a standard WPF App. Now I'm about to switch to the Ribbon for WPF and hence to the MVVM pattern.
Now I'm stuck finding the right way to handle the default CRUD Operations (Edit, Delete, Create) for my Grid.

It seems that there are two possibilities out there to achieve what i need, but i wasn't able to get even one of them working.

1st) Simply provide an ItemSource with the INotifyCollectionChanged implemented.
Problem:
I've bound my Grid to a static Field in my DataContext or ViewModel, which works in general but for any Reason not for my newly created class.
public class Stunden : ObservableCollection<Stunde>, INotifyCollectionChanged
{
    public Stunden() : base()
    {
    }
}

public class Stunde
{
    private int _satzid;
    private string _persnr;
    private string _stddatum;
    private decimal? _flsacc;

    public Stunde()
    {
    }

    public int SATZID
    {
        get { return _satzid; }
        set { _satzid = value; }
    }
    ...
  }

 XAML is working!, just not for the object above, object isnt empty but the Grids Rows are...

 Field the Grid is bound to:
  public DataGridCollectionView Stunden
    {
        get
        {
            return new DataGridCollectionView(_stunden);
        }
    }
2nd) InteractionTriggers for all the Commands like BeginningEdit, ComittingEdeit and so on, but how and where do I define those triggers? Always getting errors.. :(

Thanks in advance,
Joe

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>