listviewitem

WPF: Binding a listviewitem's background colour to a hex String property of an object

Hey. I have an object that has a string property called BackgroundColor. This string is the hexidecimal representation of a color. I cannot change this object. I'm binding a collection of these objects to a listView. What I would like to do is bind the background of the listview's row to the BackgroundColor property of the object that i...

WPF ListViewItem lost focus event - How to get at the event?

Hello, I have a listview that you select a row/item on. This is linked to a datatrigger that displays an image on the row. The image should only be displayed when the row is selected. This part works fine, however when you move the focus to something else, such as a textbox, or a messagebox is displayed, the listviewitem loses focus ie ...

Programmatically Select Item in Asp.Net ListView

After doing a quick search I can't find the answer to this seemingly simple thing to do. How do I Manually Select An Item in an Asp.Net ListView? I have a SelectedItemTemplate, but I don't want to use an asp:button or asp:LinkButton to select an item. I want it to be done from a URL. Like a QueryString, for example. The way I imagi...

WinForms ListView, Remembering Scrolled Location on Reload

I've got a list view that I'm populating with 8 columns of user data. The user has the option to enable auto refreshing, which causes the ListView to be cleared and repopulated with the latest data from the database. The problem is that when the items are cleared and repopulated, the visible area jumps back to the top of the list. So if...

adding items to listview at runtime

Hi guys. When I add new values to a listview using : Set lstView = ListView(0).ListItems.Add(, , txtName) lstView.ListSubItems.Add , , txtValue lstView.Refresh The only problem is that this only displays a blank new line in the listview, any idea how to update it correctly? Normally I am using a recordset so simply clear...

Custom ListViewItem

I must customize .NET ListView control. ListViewItem must have following structure: Is there any good tutorial which will help me to make this customization? I am using Visual Studio 2008, C#. ...

What's the best way to auto-scroll a list view to the last added item?

I use a ListView to show a list of errors as they occur in my application. It behaves and looks exactly like the Error List in Visual Studio. I want to add auto-scrolling when the last error item is selected (like how Visual Studio's Log Window auto-scrolls when you place the caret at the end). The list of errors is in an ObservableColl...

Drawing ListViewItem exceed VisibleClipBounds

I'm trying to manually draw ListViewItems on a Custom UserControl. The control itself is a wrapper around a ListView stored as a private member on the class. There is a DrawListViewItemEventHandler attached to allow manual drawing for these items, and for the most part this seems to work. The problem I have is where the text for the Lis...

C# ListView Problem Adding Items...

So, here's my question: Why won't the code in the first snippet work when the second one works fine. Also, I have set the view property to details. I've read all over how to add lvi's to the listview, and it fails every time... except for then I do it manually. So, this doesn't work... // Iterating through the rows... for (int x =...

Listview selection color

I'm playing around with wpf and I saw the following article: http://stackoverflow.com/questions/382006/wpf-listview-inactive-selection-color I want to do something similar. I want to put a border around an a listviewitem when it is selected and i want to not change the background color. The reason I want this is I want a color coded lis...

ListViewItem generating "The given key was not present in the dictionary." error

How can ItemCheckedEventArgs.Item.Selected = ItemCheckedEventArgs.Item.Checked generate "The given key was not present in the dictionary." ?? ...

How do I access ListViewItem?

The Items collection of a ListView contains the actual business objects. How do I obtain the corresponding ListViewItem given a business object (SelectedItem)? ...

Is there an easy way to associate an event with a ListViewItem?

I have a WinForms ListView, obviously containing ListViewItems. I'd like to be able to attach a click event to each item, instead of to the entire ListView (and then trying to figure out what item was clicked). The reason for this is that I need to perform a different action based on which item was selected. The ListViewItem class seems ...

Determining which ListViewItem was clicked on in a ListView when executing a ContextMenu MenuItem

I'm trying to use the context menu in a listview to run some code that requires data from which item it originated from. I initially just did this: XAML: <ListView x:Name="lvResources" ScrollViewer.VerticalScrollBarVisibility="Visible"> <ListView.Resources> <ContextMenu x:Key="resourceContextMenu"> <MenuI...

How to get the items and subitems in a listview?

Hello, I want to get all items and subitems in my listview,but all I get is "TlistItem" Here's my code: procedure TFrameAnalyzer.AddEntry(opcode:word;data:Array of byte;direction:byte); begin MessageBox(0,PChar(sListView1.Items.Item[4].ToString),'',0); end; How do I get the name of the item as string and the name of it's 2 subitem...

WPF ListView - how to add items programmatically?

Even if I know it's not ideal - I need to programmatically populate a listView (for whatever reason). I am declaring my columns in the markup: <ListView.View> <GridView> <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Path=Name}"/> <GridViewColumn Header="...

How to read the subitem values from a WPF/XAML ListView?

Hi! Enough is enough - I've just spent an hour searching around trying to find out how to read the ListViewSubItem values (if that's correct terminology in XAML) from a ListView. Here's a little ListView: <ListView x:Name="CreatableAccounts" ItemsSource="{Binding Processable}" Margin="10,0"> <ListView.View> <GridV...

Only change a ListViewItem's Checked state if the checkbox is clicked

By default, double-clicking a ListViewItem toggles its Checked state. I only want the Checked state to be changed by clicking an the item's checkbox or pressing the space bar while an item is highlighted. Is this easy to do? ...

C# ListView: ListViewItem offset possible?

I was wondering... I have a WinForms System.Windows.Forms.ListView with a bunch of ListViewItems that I'm drawing using the View.List style. Each ListViewItem has a "SmallIcon" that I fetch from the ListView's SmallImageList. My problem is that the icons are showing too close to the border on the left. I've tried to change the bounds an...

How to Apply Cosplan in WPF ListView Which Implements GridView columns

Hi, I am very new to WPF World. I have a ListView with Number of Columns. I wanted to apply Colspan for the last three columns (Only a single column header for the last Three columns with colSpan=3). In My Case there is no header Tesxt for the last 3 columns. Could some one help me out with some code sample ? I will definitely apprec...