locked
Drawing of Listview items

    Question

  • In my Metro App I have a listview. The listview is setup for multiple selection. I wish to be notified when a user selects an item, and so to do this I've added a handler for the ItemClick event, and set the IsItemClickEnabled set to true. This all works ok, so that a breakpoint in the handler is hit when ever the item is selected. The problem is that the item does not redraw, or the tick and background colour do not change, as per without handler. How can I be notified of the user selection, and keep the background colour change / tick as per default settings?

    Thnaks in advance.

    Monday, September 17, 2012 7:37 PM

Answers

  • use selectionchanged eventhandler instead?

    • Marked as answer by Jesse Jiang Monday, September 24, 2012 2:50 AM
    Monday, September 17, 2012 8:02 PM

All replies

  • use selectionchanged eventhandler instead?

    • Marked as answer by Jesse Jiang Monday, September 24, 2012 2:50 AM
    Monday, September 17, 2012 8:02 PM
  • Which language and UI kit are you using so we can get you to the appropriate forum?

    --Rob

    Monday, September 17, 2012 8:03 PM
    Owner
  • Thanks that works, but how can you get the index of the selected element, as I am using a multi select listview. I am using the selecton in the list to turn on / off elements in a graph, so I need to know the item selected by it's index
    Monday, September 17, 2012 9:11 PM
  • in the event handler, using e.AddedItems and e.RemovedItems to get the added and removed items.

    And use (sender as ListView).SelectedItems to get all selected items.

    Tuesday, September 18, 2012 6:05 PM