objectlistview

How to filter objectlistview's TreeListView?

笑着哭i 提交于 2019-12-08 12:25:04
问题 I tried to filter TreeListView using delegates like in the documentation: Filtering ObjectListView So it goes like this: this.myTree.ModelFilter = new ModelFilter(delegate(object x) { return (((MyTreeNode)x).Type == type); // this code doesn't work, why ? }); As result, myTree should include all nodes with .Type property is equal to type , in my case there are no nodes in the tree, why ???. But, if I set .Type property to type of the root node, then it will be only one root node in the tree,

Objectlistview doubleclick explained

假装没事ソ 提交于 2019-12-08 08:47:27
问题 I'm trying to implement the doubleclick function in an objectlistview object. According the developer, one should use ItemActivate instead of MouseDoubleClick . So I came up with this: private void treeListView_ItemActivate(object sender, EventArgs e) { try { ListView.SelectedIndexCollection col = treeListView.SelectedIndices; MessageBox.Show(col[0].ToString()); } catch (Exception e3) { globals.logfile.error(e3.ToString()); globals.logfile.flush(); } finally { } } Which comes up with a value

Background color row in ObjectListView filtered by cell value - VB.NET WinForms

我的梦境 提交于 2019-12-07 18:28:28
问题 Good afternoon, It's being complicated to solve the problem that i am facing. I have a ObjectListView filled and need to distinguish the rows that have a specific value in a cell. So, if the cell as a value of 1 -> yellow row, value of 2 -> orange row, and so on.. I used the default ObjectListView control provided, no code used. What is the best way to do that? Thank you! 回答1: The documentation on their site includes a very similar example through configuring a handler for the FormatRow event

Objectlistview doubleclick explained

血红的双手。 提交于 2019-12-06 15:26:38
I'm trying to implement the doubleclick function in an objectlistview object. According the developer, one should use ItemActivate instead of MouseDoubleClick . So I came up with this: private void treeListView_ItemActivate(object sender, EventArgs e) { try { ListView.SelectedIndexCollection col = treeListView.SelectedIndices; MessageBox.Show(col[0].ToString()); } catch (Exception e3) { globals.logfile.error(e3.ToString()); globals.logfile.flush(); } finally { } } Which comes up with a value for each double clicked row. But how do I get the details from that row? Here's the whole solution I'm

ObjectListView add images to items/objects

∥☆過路亽.° 提交于 2019-12-05 07:42:53
问题 I'm using the ObjectListView and am trying to add images to my items. I got it to work by looping through all the items and then manually editing the image index per item. I would like to know if this is possible when adding the items. This is the code I have at the moment: Adding the items for (int i = 0; i < listName.Count; i++) { games newObject = new games(listName[i], "?"); lstvwGames.AddObject(newObject); } Adding the images foreach (string icon in listIcon) { imglstGames.Images.Add

Custom Sorting with ObjectListView

Deadly 提交于 2019-12-03 21:56:53
问题 Let's say I have an objectListView with 3 columns ArticleNumber | OrderNumber | Status 8080 | 123.456.789 | Delivered 80 | 456.789.101 | Pending 901 | 11.111.111 | Delivered With the Automatic sorting, the smaller article number would go under the bigger article number, so it would either sort 8080, 80, 901 or 901, 80, 8080 but I want that the smallest number would be on top. On OrderNumber the same. And Status wouldn't work. On, it just sorts the ArticleNumber when I press the ColumnHeader

ObjectListView add images to items/objects

送分小仙女□ 提交于 2019-12-03 21:51:25
I'm using the ObjectListView and am trying to add images to my items. I got it to work by looping through all the items and then manually editing the image index per item. I would like to know if this is possible when adding the items. This is the code I have at the moment: Adding the items for (int i = 0; i < listName.Count; i++) { games newObject = new games(listName[i], "?"); lstvwGames.AddObject(newObject); } Adding the images foreach (string icon in listIcon) { imglstGames.Images.Add(LoadImage(icon)); // Download, then convert to bitmap } for (int i = 0; i < lstvwGames.Items.Count; i++) {

ObjectListView cast exception (for hit testing)

我怕爱的太早我们不能终老 提交于 2019-12-01 18:08:23
问题 I am using Grammarian's ObjectListView. I changed my old listviews to that, but all I do is to fill in items. But when the app starts up and my mouse is over the listview, it immediately throws an exception for: System.InvalidCastException was unhandled Message="Unable to cast object of type 'System.Windows.Forms.ListViewItem' to type 'BrightIdeasSoftware.OLVListItem'." Source="ObjectListView" How to fix this? Also I use Win7 if that's important. EDIT: I use a dictionary. It looks like I need

ObjectListView - Delete a row by clicking on a designated column with fixed content/text

感情迁移 提交于 2019-12-01 18:02:37
I have a simple question which i am not able to solve myself. I have an ObjectListView filled with some of my objects. But in addition to that I want to have another column, with a default text "Delete". On clicking that column, the selected Row should be deleted. How do I do that? You can achieve this by making the desired row editable and use the CellEditActivation event. Initialize your OLV and "delete-column" as follows: // fire cell edit event on single click objectListView1.CellEditActivation = ObjectListView.CellEditActivateMode.SingleClick; objectListView1.CellEditStarting +=

ObjectListView show icons

江枫思渺然 提交于 2019-11-30 22:12:32
Trying to put icons in ObjectListview, here's my piece of code where icon should have been put: objectListView1.SmallImageList = imageList1; deleteColumn.IsEditable = true; deleteColumn.ImageGetter = delegate { return 0; }; deleteColumn.AspectGetter = delegate { return "Delete"; }; imageList1 already have an image, this code should have put an icon next to "Delete", but it did not appear at all, looked through cookbooks and Google and I still have no idea. Can anyone help me? this is the full form code in case needed: using System; using System.Collections.Generic; using System.ComponentModel;