Your sample application has several tabs and ten different functional variants of the objectlistview family BUT if one wants to look at the code for lets say the treeview they are stuck fishing out the settings and such from the other variants in one huge code block.
I realize this is open source and the control is quite nice BUT would it be possible to arrange the controls in separate usercontrols that are then placed in the tab pages so that those of us who have an interest in seeing the code for a particular tab page just look up that usercontrol. Or is there a functional constraint within windows that does not allow the control to be placed in a usercontrol.
Also can you clarify the commercial use and licensing terms I believe I did comply a few years back BUT never used the control now I have a use case and I would like make sure that that is allowed.
I have used this awesome control in a very basic list for years just to show a list of items. I chose this control because I knew it had great features that would cover anything more I would want to do with it.
BUT WAIT, how about a very simple find feature that focuses the results at the top of the list?
I want to implement a find/search function. Just type the search text into a textbox and the ObjectListView could have the function to find the row, highlight it, and MOST importantly scroll so that the first matching row is scrolled to the top of the list.
Seems like everyone would want this yet I cannot find any instructions on how to do this through all the examples and support and cookbook and websites devoted to this control. This leads me to believe the control does not support this simple feature?
Maybe I am still missing something? If so please point me in the right direction. Again I love the control and hope it can support this basic feature.
You are right. Out of the box, ObjectListView does not provide this feature.
Mostly this is because I've never needed it -- I also use the text filtering feature[^]. This does what you are asking very nicely.
A lesser reason is that moving an item to the top of a ListView is actually tricky and error prone. If you have a look at the code in ObjectListView.TopItemIndex, you can see the lengths I go to try and make it work. A bigger limitation is that it will only work in Details view and will never work when showing groups (MS's limitations, not mine).
If you are willing to only search on the primary column's contents AND you are in details view AND you are not showing groups, you can do this:
I've been fiddling with a simple OLV and I can't seem to make the basic sorting work. Do I have add some code or is it activated by default?
- The property "Sorting" of the ObjectListView is set to None. I tried "Ascending" or "Descending" but that didn't change anything.
- Each of my columns has the "Sortable" property set to True.
- I debugged the "_BeforeSorting" event and everything seems like it wants to sort.
I'm fairly new to C# and some of the code from the example are beyond my comprehension as of this moment.
I took the time to check your page and the examples. It helped me cleanup my code a little. Thanks.
Thing is, I'm doing pretty much basic stuff at first so that I can understand how to work with your ObjectListView. I'm just populating 1 string column from a list that gets populated from a webservice (SQL Server Reporting Services). The list seems fine to me. This is my code to fill the ObjectListView:
rsItemInfo = new List<RSItemInfo>();
rsItemInfo = RSItemInfo.GetRSServerItems(rsServer);
If you need to see more code, tell me what you want to see.
PS: I will try do drop and recreate the component to see if it works (the old reboot solution )