WPF Listview not allowing item to be selected

Discussion in 'C#' started by Loony064, Aug 28, 2010.

  1. Loony064

    Loony064 New Member

    Aug 28, 2010
    Likes Received:
    Trophy Points:
    Hey all!

    I'm working on a project at the moment that uses WPF with C#. It has 4 tab pages (view, add, edit, delete records). On the view tab page, there is a listview that displays the database (SQL using linq-to-sql) records from a particular table (lets call it 'customers'). I can select a record to edit/delete from this listview.

    On the add tab page, i can add a new item (customers), as well as add related items (orders, for example) for this customer. There is a list view for the orders, that displays basic info about it. I can add a new order to the new customer record and these display in the listview. I can also select an order from the listview to edit or delete if needs be. The problem is that the listview won't let me select an item.

    When i select an item, it highlights for a second and then reverts to its normal, unselected state. The info for both listviews are similar (i.e. listview1.ItemsSource = query; listview2.ItemsSource = query; and query is a sql query to get records from the database.)

    // sample of the xaml listview code (the code for both listviews is the same except,m obviously, for the DisplayMemberPath and SelectedValuePath):

    Any idea's why its not allwoing me to select an item from one listview but it is from the other and how I can fix this issue?


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice