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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:51:17+00:00 2026-05-25T13:51:17+00:00

When I modified a value of a item which bound in listbox, I expected

  • 0

When I modified a value of a item which bound in listbox, I expected a sorted order should changing automatically.

But it doesn’t.

Am I call a .SortDescriptions.Clear() method and reallocate a SortDescription in this case?

.Refresh() doesn’t work.

EDITED

i bound and setted the data like this;

public Records myRecents;


....

//lbToday is a ListBox.
//ModifiedTime is a DateTime.
this.lbToday.ItemsSource = new ListCollectionView(myRecents);
this.lbToday.Items.SortDescriptions.Add(new SortDescription("ModifiedTime", ListSortDirection.Descending));

When the app launched in first time, it showed correct result. But when I modfying a value of item (in this case, ‘ModifiedTime’ property), a view doesn’t changed. And I re-launched app, it showing a correct result again.

EDITED2

Here is a source code of the Records.

public class Records : ObservableCollection<RecordItem>
{
    public Records() { }

}

and here is a source code of the ‘RecordItem’

public class RecordItem : INotifyPropertyChanged
{

    string queryString; public string QueryString { get { return queryString; } set { queryString = value; Notify("QueryString"); } }

    DateTime modifiedTime; public DateTime ModifiedTime { get { return modifiedTime; } set { modifiedTime = value; Notify("ModifiedTime"); } }


    public RecordItem() { }
    public RecordItem(string qStr)
    {
        this.queryString = qStr;
        this.modifiedTime = DateTime.Now;
    }

    public event PropertyChangedEventHandler PropertyChanged;
    protected void Notify(string propName) { if (this.PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propName)); } }

}

Note

When I Added a Item in myRecents, (the Record class), it works well. A problem has occured only modifying a property.

  • 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-25T13:51:18+00:00Added an answer on May 25, 2026 at 1:51 pm

    Take a look at this article from Dr. WPF: ItemsControl: ‘E’ is for Editable Collection

    It should help you with your problem.

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

Sidebar

Related Questions

I've modified my run.sh file and added JAVA_OPTS=$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n but when I start
I have the following code, which is a modified version from MSDN's website, to
I have a QTreeView to which I set a subclassed DomModel:QAbstractItemModel. Each item is
I have a single item HTML select box on which I'd like to find
I've run into an issue where the SpriteBatch doesn't draw with modified Alpha of
I'm not using a listbox and data binding at the moment, but is it
If I change the ItemsSource property of a ListBox while an item is selected
EDIT: Modified title and added update. UPDATE : We no longer believe this is
I modified an existing form and saved it on my desktop as .oft file.
Has anyone ever modified the post-new.php file in their WordPress installation? I want to

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.