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 5988041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:54:09+00:00 2026-05-22T22:54:09+00:00

I’m working with an EF 4.0 Entity with a property LanguageCode of type String

  • 0

I’m working with an EF 4.0 Entity with a property LanguageCode of type String, which is a two-letter language code such as DE or EN. There is a referencial constraint and a Language navigation property as well, but the Language entity set is not included.

I’d like to simply set the language code without loading the Language entity. However, the setter throws an ArgumentOutOfRangeException. More precisely, ReportPropertyChanges method in the setter does:

OnLanguageCodeChanging(value);
ReportPropertyChanging("LanguageCode");
_LanguageCode = StructuralObject.SetValidValue(value, false);
ReportPropertyChanged("LanguageCode"); // ArgumentOutOfRangeException
OnLanguageCodeChanged();

The ParamName is not value, but rowIndex. That’s weird, isn’t it?

Google’ing the issue took me to Apparent Breaking Change in Framework 4 (MSDN social). The issue looked similar, but there is no solution. Any faint idea would be very cool… 🙂

The entity is bound in a Windows Forms application. I tried to reproduce the behaviour in a little demo application, but unfortunately I failed. Maybe the issue is not with the entities themselves?

Edit: Here is the stack trace of the exception (including external code):

System.Windows.Forms.dll!System.Windows.Forms.DataGridView.GetCellDisplayRectangle(int columnIndex, int rowIndex, bool cutOverflow) + 0x3f2 bytes
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.GetCellAdjustedDisplayRectangle(int columnIndex, int rowIndex, bool cutOverflow) + 0x3f bytes
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.InvalidateCellPrivate(int columnIndex, int rowIndex) + 0x42 bytes
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.OnCellCommonChange(int columnIndex, int rowIndex) + 0x59 bytes
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.DataGridViewDataConnection.ProcessListChanged(System.ComponentModel.ListChangedEventArgs e) + 0x7dc bytes
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.DataGridViewDataConnection.currencyManager_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}) + 0x43 bytes
System.Windows.Forms.dll!System.Windows.Forms.CurrencyManager.List_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e) + 0x7ec bytes
> DataAccessLayer.dll!DataAccessLayer.Profiles.LanguageCode.set(string value = "DE") Line 13029 + 0x21 bytes    C#
  • 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-22T22:54:10+00:00Added an answer on May 22, 2026 at 10:54 pm

    The List<T> was bound to a BindingList. Both a DataGrid and some text boxes for a detail view were bound to it. When I added a new item, the DataGrid was not notified (as List<T> does not implement IBindingList).

    The record was not added to the grid yet, so the Windows Forms’ binding magic tried to update a cell that was not there.

    I solved it like this:

    myBindingSource.DataSource = new BindingList<T>(myList); // List<T> myList
    

    (I found the issue thanks to a hint in the comments.)

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
Specifically, suppose I start with the string string =hello \'i am \' me And
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.