Editing data in a bound ListView

  • Thread starter Thread starter Khabibulla
  • Start date Start date
K

Khabibulla

Guest
Hi,

I've got a ListView that gets populated with the results from an SQL query. The query brings up many results, so I use a reader and populate the ListView (lstDetails) like this:

while (myReader.Read())
{
theDetails.Add(new detailItems() { include = true, distance = decimal.Parse(myReader[myReader.GetName(18)].ToString()), code = myReader[myReader.GetName(20).ToString()].ToString(), diam = int.Parse(myReader[myReader.GetName(21)].ToString()), clock_at = int.Parse(myReader[myReader.GetName(22)].ToString()), remarks = myReader[myReader.GetName(25).ToString()].ToString() });
}

lstDetails.ItemsSource = theDetails;


All is fine, but ultimately what I want the user to do is to be able to manipulate some of the data in this list view, but it does NOT need to go back into the database. It is to be used for something else. Is there a way to edit the data in the listview even though it's linked to a datasource? Or should I be taking a totally different approach to populating/editing the data in this ListView??

Basically what i want is for the user to select a row in the ListView, and then click on the 'Back' or 'Forward' button to increase the value in the 'Distance' column by the amount specified (ie. .5).

1603910.png





Brian

Continue reading...
 
Back
Top