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

  • SEARCH
  • Home
  • 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 6711451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:08:29+00:00 2026-05-26T08:08:29+00:00

I am binding a DataGrid to an ObservableCollection as: <DataGrid ItemsSource={Binding Path=MyCollection, Mode=TwoWay}> The

  • 0

I am binding a DataGrid to an ObservableCollection as:

<DataGrid ItemsSource="{Binding Path=MyCollection, Mode=TwoWay}">

The property in the viewmodel looks like:

public ObservableCollection<MyType> MyCollection
{
    get { return this.Model.Collection; }
    set { /* Empty but needed for data binding */ }
}

The set accessor for MyCollection is never called or used but is required by the TwoWay DataBinding. The contained Model class initializes Collection at construction because it is required to place the object in a valid state. Is there anyway to get around this unnecessary accessor or are there any alternatives to this?

  • 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-26T08:08:30+00:00Added an answer on May 26, 2026 at 8:08 am

    Set the Mode=OneWay and you don’t need a set.

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

Sidebar

Related Questions

I use the following DataGrid <DataGrid Grid.Row=1 Grid.Column=1 Name=Grid ItemsSource={Binding} AutoGenerateColumns=False > <DataGrid.Columns> <DataGridTextColumn
I have a Silverlight 4 DataGrid which has its ItemsSource bound to an ObservableCollection
I'm trying to set the ItemsSource property of a DataGrid named dgIssueSummary to be
I am binding a WPF application DataGrid to an ObservableCollection via the DataGrid's ItemSource.
I have such DataGrid <DataGrid AutoGenerateColumns=True HorizontalAlignment=Stretch Name=dataGrid1 VerticalAlignment=Stretch ItemsSource={Binding DataList} IsReadOnly=True/> In my
I have an ObservableCollection and a Datagrid. What I do is: datagrid.ItemsSource = observableCollection1;
I have implemented a DataGrid that way: <DataGrid x:Name=MyDataGridFilter ItemsSource={Binding} IsSynchronizedWithCurrentItem=True AutoGenerateColumns=False> <DataGrid.Columns> <DataGridTemplateColumn
Binding a List collection to a datagrid. How can you limit what properties will
I create DataGrid Columns with Binding (where i is a Int value): dataGrid.Columns.Add(new DataGridTextColumn
Currently I am binding a dataset with a datagrid. ds = query.ExecuteReadQuery(select PollQuestionText as

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.