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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:20:02+00:00 2026-05-26T10:20:02+00:00

I am manually binding an ASP.NET ListView to an array of objects sorted alphabetically

  • 0

I am manually binding an ASP.NET ListView to an array of objects sorted alphabetically by name. After editing an item, the DataSource is set again and DataBind is called. If the name changed, the item you just edited may have moved, potentially to another page even.

For example; you just renamed Hot Dog to Sausage, so Sausage moved after ItemUpdating completes.

--- OLD LIST ---   --- NEW LIST ---
    Hamburger          Hamburger
    Hot Dog______      Pizza
    Pizza        |_____Sausage

Is this behavior you would expect from a form? When you edit a row, should you expect to see that row after saving it? Should it be in the exact same position? Should I display only the record you just edited after saving?

As for the technical side of maintaining the previous order after saving, and potentially changing the order;

I know why this is happening. I’m looking for ideas of avoiding it.

I’m thinking about dropping both combining the controls of EditItemTemplate into ItemTemplate and setting visibility on read-only / editable controls based on the ListView EditIndex.

This seems feasible but I’m wondering if you fine folks have any other ideas.

  • 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-26T10:20:03+00:00Added an answer on May 26, 2026 at 10:20 am

    The behavior that you are seeing here is the typical desired output as once you make the change the information is properly sorted. If you have a need to keep the old structure you are most likely going to have to go a route similar to what you mentioned in your post.

    However, I would take a second and see if this is really what your users are going to want, I could see this getting really confusing after a large number of edits.

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

Sidebar

Related Questions

Recently I have been watching Plural Sight ASP.NET videos on data binding, and I
When manually generating a JSON object or array, it's often easier to leave a
I am implementing an error handling strategy in an ASP.Net MVC 3 application. I've
I am currently programming an ASP .NET FormView. The twist here is that I
I have some legacy classic ASP code (not ASP.Net, but ASP), and I want
I have a databound list view and can set all the column widths manually
I have an ASP.NET MVC project with a form. In the Action method that
I have a gridview control that i am manually binding the data in. When
I have a binding for ListViewItem, which is under gridview/listview/scrollviewer. <Setter Property=IsSelected Value={Binding IsSelected}/>
I'm using System.Data.OracleClient which does parameter-binding by name and are verifying that CommandText and

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.