Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 514133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:29:35+00:00 2026-05-13T07:29:35+00:00

I am really stuck trying to implement RIA Services with MVVM and a crud

  • 0

I am really stuck trying to implement RIA Services with MVVM and a crud datagrid. I think i’m missing some key idea. All of the examples I have seen use a submit button or similar to send the data back to the client. I’d rather submit as soon as a row is added/deleted/modified. I thought of a couple of approaches:

  • Have my IEnuerable Itemsource property automatically bound to my context’s entitycontainer. I tried this but I cant set the context’s entities from the property.
  • Capture the row change events and manually tell my context that is has changed items. This doesnt feel right though in a MVVM design considering my Commodity property should reflect changes in the datagrid.

Additionally, how do I tell RIA Services what method it should be using for a particular crud operation? Does this happen on the client or server?

Note I am using the ComponentOne datagrid, though I dont think its behaviour would differ from the normal Silverlight datagrid for this simple example.

View:

<c1grid:C1DataGrid x:Name="C1Grid"                                    AutoGenerateColumns="False"
ItemsSource="{Binding Commodities}">
<c1grid:C1DataGrid.Columns>
<c1grid:DataGridTextColumn Binding="{Binding Name, Mode=TwoWay}"></c1grid:DataGridTextColumn> 
</c1grid:C1DataGrid.Columns>
</c1grid:C1DataGrid>

ViewModel:

public class CommodityViewModel : Model
    {
        private CommodityContext _context;
        private Commodity _selectedCommodity;

        public IEnumerable<Commodity> Commodities
        {
            get { return _context.Commodities;}
            //Setter wont work here

        }

        public CommodityViewModel()
        {

            _context = new CommodityContext();
            _context.Load(_context.GetCommoditiesQuery(), (LoadOperation<Commodity> loadOperation) =>
            {
                RaisePropertyChanged("Commodities");
                _context.Commodities.EntityAdded += Commodities_EntityAdded;

            }, null );

        }

        private void Commodities_EntityAdded(object sender, EntityCollectionChangedEventArgs<Commodity> e)
        {
            //how does RIA know to use my AddCommodity method on the server side? Where do I set this?
            _context.SubmitChanges();
        }



    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:29:36+00:00Added an answer on May 13, 2026 at 7:29 am

    Ok so perhaps my answer is only relevant to users of the C1 DataGrid – but they have implemented a special API for interacting with RIA Services. Details available here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 256k
  • Answers 256k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use the Strategy pattern. Write an interface that describes what… May 13, 2026 at 10:37 am
  • Editorial Team
    Editorial Team added an answer I think you want statvfs (if by pagesize you mean… May 13, 2026 at 10:37 am
  • Editorial Team
    Editorial Team added an answer It should be possible by calling PackageManager.getInstalledPackages() with GET_PROVIDERS. EDIT:… May 13, 2026 at 10:37 am

Related Questions

So I have used - http://www.roundedcornr.com/ - to generate some rounded corners via CSS.
I have a daemon that reads a configuration file in order to know where
Satisficing (a portmanteau of satisfy and suffice) is a decision-making strategy which attempts to
I'm currently working on a reasonably simple MVC app which allows the user to
I am trying to implement some sort of MVC in Java. Actually it's more

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.