listview

How to handle onclick event in a listview button?

If I have listview control with a button in the item template, how do I handle the onclick events for each of the buttons that ends up getting generated in the listview? ...

Horizontal scroll winforms listview

Anyone know if its possible to enable horizontal scrolling ONLY in a windows forms listview (viewmode set to large icons). What I want to do is make a listview whose height is sufficient to only show one row of icons, and I don't want to have multiple rows. Just one very long row that a user would have to scroll horizontally to get to ...

Getting the item under mouse cursor in a listview control?

Basically I am trying to implement a feature where if the user presses a key, I want to find out the item under the mouse cursor. So I don't use Mouse events but Keyboard events which doesn't give me a ListViewItem of course. I just don't know in what space I need to get the mouse position and convert it into the control's space. Any ...

Is it possible to set a checked listview item to mixed state?

The CheckBox control exposes both boolean Checked and System.Windows.Forms.CheckState enum CheckState properties, which allow you to set the control to either checked, unchecked, or mixed state (Indeterminate enum value). I want to set a ListView item's state to Indeterminate, but only the Checked property seems to be available. So, is ...

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)? ...

Drawing an Image to a subItem in the ListView

My Listview is setup in the details view with the following column headers: Image Name || Image Location || Image Size || Image Preview I would like to know if there is a way to draw an image in the 4th column there. The only way I know, is to set this.listview1.OwnerDraw = true this.listView1.DrawColumnHeader += new System.Windows.F...

WPF ListView turn off selection

Hi everyone, I have a simple WPF ListView and a simple question: Is it possible to turn off the selection, so when user clicks row, the row is not highlighted? I would like the row 1 to look just like row 0 when clicked. Possibly related: can I style the look of the hover / selection? Eg. to replace the blue gradient hover look (li...

How to populate listview with a lot of information without blocking?

Hi there! I am creating an array of ListViewItems on a background thread and then i populate my listview with it on the ui thread. The problem is that if the array is too big the ui blocks while the listview is updated. Is there a way to populate the listview with a small impact on the ui? ...

multiplying input fields within a listview using jquery

I have a listview with lists lines of an invoice (Which are editable), each invoice line has a qty and a rate and I want to show the line total on the client show so if the qty or rate is changed the total changes before the postback. I have applied the below which gives the right result but doesn't work with multiple line items. The qt...

c# ListView unable to check a checkbox! Strange problem.

This is a strange problem, I've not added much code as I don't know were to start. I have a listview control in virtual mode, if I filter the listview to show me all people called John, I then see 3 users called John, I then cancel the filter setting all values to null and return all data to the listview, I now have several hundred items...

How do I get the values of the controls in the first row of a listview in c# aspnet?

I can get the the first row in a ListView item in c# aspnet 3.5 by: ListViewDataItem theFirstItem = ListView1.Items[0]; But then how do I get the get the value of the item's CommandArgument ( an int) < %# Eval("PKey") %> in the aspx. Or get the contents of < asp:Label ID="lblStatus" runat="server" Text= '<%# Eval("Status") %>...

Stretching ListView to a single screen?

A simple ListView with, say, 6 rows (Views). Now, I want it to fit exactly a single screen. Any straightforward way to do this? Or should I go with a custom view? ...

WPF Custom Controls Deriving from ListView unable to override default style

I am making a simple display grid that derives from ListView, and uses GridView. I want to create it in its own assembly, so i thought of using a CustomControl library and making my ListView there. the problem i have is that when i use the line in the static constructor DefaultStyleKeyProperty.OverrideMetadata(typeof(ExtendedGridView), ...

WPF ListView Programmatically Select Item

Oh, man. I'm feeling the WPF pain this week. So for my next trick, I'm now unable to figure out how to select an item programmatically in a ListView. I'm attempting to use the listview's ItemContainerGenerator, but it just doesn't seem to work. For example, obj is null after the following operation: //VariableList is derived from Bi...

wpf listview right-click problem

so I have attached a context menu (right-click menu) to a wpf listview. unfortunately, when you right-click it brings up both the menu and selects whatever item you are over. Is there a way to shut off this right-click select behavior while still allowing the context menu? ...

Scroll ListViewItem to be at the top of a ListView

In WPF, I know I can use ListView.ScrollIntoView to scroll a particular item into view, but it will always do the least amount of scrolling so that the item is shown. How can I make it scroll so that the item I want to show is scrolled to the top of the ListView? I've thought about calling ScrollIntoView twice, once for the item I wan...

BackColor of ListView ColumnHeaders

Is there a way to set the BackColor of the ColumnHeaders of a ListView? ...

Hierarchical Databinding with Linq to SQL

I am attempting what I think is a rather simple databinding scenario with Linq To SQL. I have a table of FacultyMembers, whose schema looks something like this: FacultyMemberID - int PK Name - nvarchar UniversityID - int FK to University table and so forth. There are various other string properties. I generate LTS DataClasses. I dr...

WPF - How to find item clicked on in menu handler method?

How can the handler method of a WPF menu item determine which item in a ListView was clicked on? Edit: The menu is a context menu which has been set for the ListView. The problem is to find which ListView item has been clicked on when the context menu item is selected. ...

Android Endless List

How can I create a list where when you reach the end of the list I am notified so I can load more items? Thanks, Isaac ...