天道酬勤,学无止境

objectlistview

Objectlistview how to change the text in the group header?

Question I want to change the name of the group header but i cant find any solutions in the documentation or on google. the text in the header should be a time which is summed up in the group. this is how it should look like: Answer1 the text in the header should be a time which is summed up in the group. No problem :) olv.AboutToCreateGroups += delegate(object sender, CreateGroupsEventArgs args) { foreach (OLVGroup olvGroup in args.Groups) { int totalTime = 0; foreach (OLVListItem item in olvGroup.Items) { // change this block accordingly MyRowObjectType rowObject = item.RowObject as

2021-06-22 19:33:57    分类:技术分享    c#   listview   sum   objectlistview

How to wordWrap the text in a column using ObjectListView

Question For example I have a big sentence: "I like to eat pie and have fun around the house all day long!" And I want it to appear like this: "I like to eat pie and have fun around the house all day long!" In this post: Multi-line list items on WinForms ListView control? Grammarian said that you only need to have WordWrap on but I cannot find that option. Thanks for the help in advanced Answer1 Each column has a WordWrap property. Set that to true and the text of that column will wrap. Remember, the list must be OwnerDrawn for the wrapping to be visible. EDIT: I looked again today, and you

2021-06-12 17:00:48    分类:技术分享    c#   .net   listview   objectlistview

How do I add/remove items to a ListView in virtual mode?

Question If I'm using a ListView in virtual mode then, as I understand it, the list view only keeps track of a small number of items in the list. As the user scrolls it dynamically retrieves items it needs to show from the virtual list. But what if an item is added or removed from the master list? If an item is added/removed outside of the range of indexes being shown by the list view then I would assume the list view would show the added/missing items when the user scrolls to that index. Is this correct? But what if an item is added/removed from the range of indexes the user is currently

2021-05-31 15:13:50    分类:技术分享    c#   .net   winforms   listview   objectlistview

ObjectListView cast exception (for hit testing)

Question 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 to use the SetObjects method instead of adding items. Ok this is great, but I am just using

2021-05-18 10:42:03    分类:技术分享    c#   .net   vb.net   winforms   objectlistview

ObjectListView show icons

Question 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

2021-05-18 07:41:42    分类:技术分享    c#   icons   objectlistview