listviewitem

Populating a ListView in a multithreaded app

I need to retrieve a set of data from a database, then populate a ListView with the data. I understand multithreaded form controls and the proper techniques for updating controls from worker threads. Here's the dilemma: I may have several thousand entries in the ListView... rather than Invoking the form thread to update them one at a ...

How to get ListViewItem under MouseCursor while dragging sth. over it

Hi SO-followers, I'm implementing drag & drop on a ListView. I already managed to get the ListViewItem under the cursor when dropping on it but I would like to get the ListViewItem under the mouse cursor while I'm dragging sth. over the ListView-Control. I would like to select the ListViewItem (selected=true) like in Windows Explorer w...

How to delete a ListViewItem when bound to a DataView

How do I delete a selected ListViewItem from a WPF ListView when the ItemsSource is set to a DataView? I can get the ListViewItem that was selected and then how do remove the actual row in the DataView? DataView dv = (DataView)myListView.ItemsSource; ListViewItem lvi = (ListViewItem)myListView.ItemContainerGenerator.ContainerFromItem(m...

Best way to manage ListViewItems in a Detailed ListView?

I've adopted the following pattern for putting ListViewItems in a ListView with multiple columns (when I want to display information about a list of MyObject types), and I'm just curious to see if this is the best way to accomplish this task, or if there's anything more efficient and readable in code: Create an inherited ListViewItem c...

WPF ListView ItemTemplate questions

Let's say that I've got the following class hierarchy : public static class Constants { public enum MyEnum { Value1 =0, Value2, Value3 } } public class Data : INotifyPropertyChanged { public Data(string name, ushort id, Constants.MyEnum e) { DataName = name; DataId = id; ...

listView.Items.Contains with DateTime/String?

How do I check if a listView contains a DateTime or String? I've tried if (!listView1.Items.Contains(SetAlarm.Value)) But it cannot convert System.DateTime to System.Windows.Forms.ListViewItem. ...

Jump to listviewitem by keypress

Hi, I'm looking for any way - and I'm pretty sure there is a default way but don't now how - to select an item in a listview by pressing a key. And the possiblity to specifity the selection by intipping more than one letter. If I have this items in a list: Cat Country Tree By pressing "c" the item "Cat" should be selected. And by i...

how to set some of the listView insertItem data manually (in code)? (simple but need help)

hi i have an insertItemTemplate as follows, and all i want to do is to programmatically add all the values myself, without asking the user, of course, the userID, picID and dateTime should not be asked to the user, the comments field of course, i want to ask the user as they are leaving a comment about a picture on the site :)... seems s...

Change ListViewItem Bounds

Hi guys, Is there any way to set the bounds of a all ListView items in LargeIcon mode to a specific size? I want to manually draw a rounded rectangle background for each of the items, but in the DrawItem event e.Bounds differs based on the state of the items. Thanks. ...

complex listeviewitem image load hang application problem.

I am suing Listview and customize listview to display image inside a list item. I want display image with every search result. to display complext listeim i am following the following example http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/List4.html inside wrapper class i am initiating new thread...

How to automatically select a WPF ListViewItem

I have a ListView in my WPF UserControl using an ItemTemplate to display the items. Within the template is a button. When I select one item and then click on the button of another item, the previously selected item is still selected. I wonder how to automatically select the item the button is in when the button is clicked. Xaml <UserCo...

make a class convertible to another class vb.net

Is it possible to make my custom item class so that I can put it straight into a listviewitem? What I mean is a listview and I want to be able to do Listview.items(0) = Item Or is this not possible? ...

WPF ListView Nested Tables with Matching Columns

I have a business entity like so: public class Entity { public string Name; public string Description; public Entity Parent; public ObservableCollection<Entity> Children } I would like to bind a ListView to a collection of Enities and get a nested table out of it like this: http://leeontech.wordpress.com/2008/03/11/li...

C# skip checkbox listView

I have a listView that lists a bunch of files, and a set of checkboxes that allow users to download them from an FTP server, like so: Filename Size Last modified New version [ ] someimage.jpg 120 kB 2010-01-13 16:12:59 Yes [ ] otherfile.zip 12 kB 2009-12-29 09:33:15 No [ ] folder - - ...

WPF ListView DoubleClick OriginalSource problem

Hi ! I attached an EventHandler to the MouseDoubleClick event. <Style TargetType="ListViewItem" BasedOn="{StaticResource MyStyle}"> <EventSetter Event="MouseDoubleClick" Handler="ListViewItem_MouseDoubleClick" /> </Style> private void ListViewItem_MouseDoubleClick(object sender, RoutedEventArgs e) {}...

C# ListView item selection problem after deleting an item.

Using Visual Studio 2008, .Net 3.5 I have a ListView loaded with a bunch of items. I have a right-click popup for removing an item. After removal of an item, I redraw the list view by re-accessing my primary data, and reset the selected item. However, the selected item does not show as selected. An idea of the code: public ListView m_...

VB.NET typecasting a listview tag object

In C# i would do something like: mytype val = (mytype)mylistview.SelectedItems(0).Tag; how can I do the same thing in VB.NET? ...

Android ListView item highlight programmatically

Hi all, I know it's been asked around but I haven't found quite the answer yet (new to Android so sorry about the ignorance) my app's launch Activity has an EditText (called searchbox) , a ListView (designations) and a Spinner (types) I use the EditText as a searchbox, I have to pass the string through a custom editing to make searchi...

Associate an Activity with an item in XML ListViews in Android

I have a ListView that is populated using an XML file. However, I want each item, when clicked, to start a new Activity related to that item. I understand how to use OnItemClick to start a Toast that shows the selected item's text. However, since the ListView is populated from an XML there is not a specific Id for each item in the lis...

How does ListView.ItemCollection.Contains() work?

Hi everyone, I'm copying ListViewItems from one ListView to another, sth. like: foreach (ListViewItem item in usersListView.SelectedItems) { selectedUsersListView.Items.Add((ListViewItem)item.Clone()); } If I want to use ListView.ItemCollection.Contains() to determine if an item was already copied I always get false: foreach (Li...