listview

Forcing a ListView to draw in the background

I have a ListView which sometimes I need to put around 10000 items in. ListViews don't really handle this well, and they lock up for a couple of seconds while they sort the items and draw them. If you add the items in individually, it's even worse, locking up for nearly a minute. To get around this, I thought I'd try populating the List...

How to implement sorting in a listview while maintaining neighboring columns?

I have a ListView that has several columns. One of them contains "Names", the other contains "Amount". I would like to allow the user to click the Names column in the listview and have it sort alphabetically and also allow the user to click the "Amount" and have it sort numerically (higher/lower - lower/higher). What is the best way...

Synchronized ListViews in .Net

I'm working on a control to tie together the view from one ListView to another so that when the master ListView is scrolled, the child ListView view is updated to match. So far I've been able to get the child ListViews to update their view when the master scrollbar buttons are clicked. The problem is that when clicking and dragging t...

What does a ListViewSubtemCollection use for its keys?

I am trying to get the value of some ListViewSubItems, but I have no idea what values it uses for its keys. I have some simple code: protected override void OnItemDrag(ItemDragEventArgs e) { base.OnItemDrag(e); ListViewItem item = e.Item as ListViewItem; string val = item.SubItems[???].ToStri...

Why doesn't my ListView display List or Details items?

Using C# .NET 2.0, I have an owner-drawn ListView where I'm overriding the OnDrawColumnHeader, OnDrawItem and OnDrawSubitem events. If I set the View property to Details at design-time, everything works beautifully and I can switch the View property and all view modes display as they should (I'm not using Tile view). However, if I star...

Reading Comma Delimited File and Putting Data in ListView - C#

Alright, I'm trying to read a comma delimited file and then put that into a ListView (or any grid, really). I have the delimiting part of the job taken care of, with the fields of the file being put into a multidimensional string array. The problem is trying to get it into the ListView. It appears that there isn't a real way of adding...

How to efficiently filter a large LIstViewItemCollection?

So I have a ListView with an upper limit of about 1000 items. I need to be able to filter these items using a textbox's TextChanged event. I have some code that works well for a smaller number of items (~400), but when I need to re-display a full list of all 1000 items, it takes about 4 seconds. I am not creating new ListViewItems eve...

Displaying an IGrouping<> with nested ListViews

I need to retrieve a set of Widgets from my data access layer, grouped by widget.Manufacturer, to display in a set of nested ASP.NET ListViews. The problem is that (as far as I can tell) the nested ListView approach requires me to shape the data before using it, and I can't figure out the best approach to take. The best I've been able t...

Adding Text to Clipboard on Click of ListView Column Header - C#

Is there a an event for ListViews that are activated when one of the column headers are clicked on? The plan was to add some text to the user's clipboard when they click on the column header. Is there any easy way to do this? Thanks for any help you can give on the subject, I appreciate it! ...

Prevent user from resizing columns with WPF ListView

hi there, i wonder how i can prevent a user from resizing GridViewColumns withing a WPF ListView control as google doesn't came up wit a solution. probably one of the wpf guru's over here ;) ...

C# Custom ListView

Does anyone have any info on creating/drawing a customised ListView object? Currently Im working on a project that requires a customised look and feel within the application. I am using a standard (Windows.Forms) ListView which is not in the same style as the rest of the GUI. We are NOT using a toolbox for custom controls, all controlls...

A working Drag&Drop enabled ListView implementation for WPF?

Hi, Been trying to find a working implementation of a WPF listview (or listbox) where you can order items by dragging them up or down. I have found a few, but none really works, for example this one http://www.codeproject.com/KB/WPF/ListViewDragDropManager.aspx?msg=2765618#xx2765618xx stops working once you have list where you need to ...

Find a Control in Asp.net Listview Inside the Selected Item Template

I'm converting functionality from an asp.net Gridview to a Listview. In the gridview when the selected item changed I would grab a value from a label in the selected row and write it to a different label outside of the gridview. Protected Sub grdModules_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles g...

In a WPF ListView how can I prevent auto scrolling?

I have a WPF ListView which currently scrolls everytime I click on an item which is only partially visible. How can I keep the control from scrolling that item into view (instead simply selecting the partially visible one)? This behavior is very annoying when doing a drag from this control. Thanks. Added: I am looking for a solut...

Scroll WPF Listview to specific line

WPF, Browserlike app. I got one page containing a ListView. After calling a PageFunction I add a line to the ListView, and want to scroll the new line into view: ListViewItem item = ItemContainerGenerator.ContainerFromIndex(index) as ListViewItem; if (item != null) ScrollIntoView(item); This works. As long as the new line is i...

Displaying totals in the ListView LayoutTemplate

I'm using the ListView control (ASP.NET 2008) to show a bunch of lines of data, and at the bottom I want some totals. I was initially going to define the header and footer in the LayoutTemplate and get the totals with some local function, i.e. <%#GetTheSum()%>, but it appears that the LayoutTemplate does not process the <%#...%> syntax. ...

ListView with LINQ Datasource insert template

It seems like this should be straightforward but I'm boggling. I've got my listview all setup and bound to my LINQ datasource. The source is dependent on a dropdown list which decides which branch information to show in the listview. My edit template works fine but my insert template won't work because it wants the branch ID which I w...

C# ListView Detail, Highlight a single cell

Hello, I'm using a ListView in C# to make a grid. I would like to find out a way to be able to highlight a specific cell, programatically. I only need to highlight one cell. I've experimented with Owner Drawn subitems, but using the below code, I get highlighted cells, but no text! Are there any ideas on how to get this working? Th...

How can I implement the "tap and hold" behavior in an MFC CListCtrl?

How can I implement the "tap and hold" behavior in an MFC CListCtrl? I have an MFC CListCtrl in a CDialog and I need to add to the CListCtrl the "tap and hold" behavior. That is what I mean for "tap and hold": If the user clicks (a "standard" click with the left button of the mouse) on a CListCtrl item then function A will be called. ...

Changing (Enable/Disable) GroupStyle in ListView for different category items

Hi All, How can I switch between GroupStyles for ListView based on some conditions at run time. For instance I need to use Default for items that that have GroupStyle Header name null, and if it is not null then use custom GroupStyle them? I tried GroupStyleSelector, and it doesn't work, because it works for multi level grouping, and ...