|
|
Comments and Discussions
|
|
 |

|
This control has helped me a great deal, so I'm pleased to help others with it when I can
|
|
|
|

|
I have been chasing a bug for several days that gives me; "...is not a parameter-less method, property.." as text in my subitem. I thought this was a C# error but found nothing on Google, so searching for the text found it in OLV Munger.cs. It seems that on a certain OLV column that if I use an AspectName I get this error instead of the text that should be in that field. If I remove the AspectName then I just get a blank field, instead of my data. There does not seem to be anything unique about the column, but it will not show the data (that is confirmed to pass into OLV), where all the other columns work as designed.
Anyone got any suggestions?
Thanks
modified 24 Apr '13 - 7:29.
|
|
|
|

|
If you get the "...is not a parameter-less method, property or field of type..." warning, then it's exactly that--the Aspect you've used does not exist in your model object. e.g. if your Aspect is "FirstName", then make sure your model object contains a "FirstName" property, field, or parameterless method, i.e. model.FirstName. Remember also that this is case sentitive. If your Aspect is deeper, e.g. for a "car" model, Engine.Oil.IsEmpty, make sure every entity along the way exists. In any case, there must be something very subtly wrong in your aspect name.
|
|
|
|

|
Thanks for that feedback. As it turns out i'm not using Aspects at all. I put a name in the properties field because I discovered that if I left that property field empty no data would be printed into sub- items, so I added a simple unique name in each column, but don't use it.
Just tried removing All aspect names, but just got an (null) printed to control and nothing else.
this bug has got me stumped.
thanks
|
|
|
|

|
If you're using an ObjectListView, then you probably should be using aspect names on each of your columns. This is the OLV's flagship way of automagically putting the value of your model objects' properties, etc. into the columns/cells of the list view. You can do this from the Designer or from code, but if your columns are static and you created them in the designer, then you probably should put the aspect name in there at the same time.
public class MyModel
{
public string FirstName { get; set; }
public string LastName { get; set; }
public MyModel(string first, string last)
{
this.FirstName = first;
this.LastName = last;
}
}
public void SomeInitializationMethod()
{
FirstNameColumn.AspectName = "FirstName";
LastNameColumn.AspectName = "LastName";
}
public void AddItems()
{
MyModel model1 = new Model("John", "Smith");
MyModel model2 = new Model("Jane", "Doe");
myOlv.AddObject(model1);
myOlv.AddObject(model2);
}
|
|
|
|

|
I confirmed every Aspect has been given a string name in the designer. I'm back to the "...parameter-less..." message again. Looking at your code its a bit different than the online example. Here is what I do to load ObjectListView;
watchlist.Add(new ConnectionInfo( sDeviceName, IPAddress, Connected, disconnected, Alert, deviceType));
objectlstConnectionList.SetObjects(watchlist);
You add objects one at a time and I add a list one time when the list is completed. I verify the list is complete with no NULLs or any missing data in any field.
Thanks
|
|
|
|

|
The error message should tell you everything you need to know.
If the message is:
* 'SomeMethod' is not a parameter-less method, property or field of type 'SomeType'
then:
* "SomeMethod" is the text you entered into the AspectName of the column. This should be the name of a property on your model object.
* "SomeType" is the type of your model object that you added to ObjectListView.
If you post the whole error message, it might be easier to see what is going wrong.
Please, please, please read the Getting Started page.
Regards,
Phillip
------------------------------------------------------------------------
Phillip Piper www.bigfoot.com/~phillip_piper phillip.piper@gmail.com
A man's life does not consist in the abundance of his possessions
|
|
|
|

|
I created my app from the example app given in the Getting Started page. I love the idea you guys have pushed forward here, but Dang has this issue been a bear to resolve.
The error I receive is printed in several cells of my OLV and is;
"DeviceIP is not a parameter-less method, property or field of type Dashboard.child_class.ConnectionInfo"
The LIST that I feed to the OLV is a simple 6 string list.
I made this simple example app and it gives the error too;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public List<ConnectionInfo> watchlist = new List<ConnectionInfo>( );
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
AddToWatchedDeviceList2("device name", "99.222.33.44", "saturday", "sunday", "-", false, "controller");
}
public void AddToWatchedDeviceList2(string sDeviceName, string IPAddress, string Connected, string disconnected,
string Alert, bool emailChecked, string deviceType)
{
watchlist.Add(new ConnectionInfo( sDeviceName, IPAddress, Connected, disconnected, Alert, deviceType));
objectlstConnectionList.SetObjects(watchlist);
}
}
public class ConnectionInfo
{
public string DeviceName{ get; set; }
public string IpAddress { get; set; }
public string LastConnection { get; set; }
public string LastDisconnected{ get; set; }
public string Alerts { get; set; }
public string DeviceType { get; set; }
public ConnectionInfo(string deviceName, string ipaddress, string connected, string disconnected, string alert,
string deviceType)
{
DeviceName = deviceName;
IpAddress = ipaddress;
LastConnection = connected;
LastDisconnected = disconnected;
Alerts = alert;
DeviceType = deviceType;
}
}
}
|
|
|
|

|
The property name in your ConnectionInfo class is "IpAddress" but the aspect name it's complaining about is "DeviceIP". The aspect name MUST match a member name from your class or else you'll get the error as described.
|
|
|
|

|
First off... THANK YOU!!! I don't want to think about how many hours a chased that issue.
Second.... OMG... could that be any more subtle. The error msg maybe could use a little revision for clarity. perhaps something like... "Hey you idiot, your aspectname does not match your class parameter name", or something to that extent.
thanks again
|
|
|
|

|
In desperation I just removed the OLV from project and then added it back again. I still get the error message, but now its in a completely different column. If none of my code changed, and I only removed the OLV and then put it back on the form in [Design], then that would indicate what?
thanks
|
|
|
|

|
Hi, I have a graphical bug with OLV.
I use several image in a OLV. All of this images have the same size, but some images are resized and some images not.
In this screen capture, the TV logo and the HDTV logo are the same size but the HDTV logo is resized and become very blurry !
http://img694.imageshack.us/img694/917/guidedelutilisateurmozi.png[^]
I don't know if it's a OLV bug, Windows bug or .NET bug. If someone can help me...
|
|
|
|

|
Did all the images come from the same format? Same dimensions? I'd check to make sure the size & maybe even bit depth are consistent and what you expect. If the sizes are a bit off, it could skew the resultant image.
|
|
|
|

|
All images are 26x26 size, PNG format (bit depth unknown, I will look this evening) , from Icon8.
I use them in a VB Project and images are in Resource.
|
|
|
|
|

|
What is the row height in your OLV? Does it match the height of the image (26px)? At least if it does, you can rule resizing out as a possible cause.
|
|
|
|

|
If this problem is only occurring in one image, that image is likely to be the problem.
Try duplicating an image that currently works and using that instead of the image that is giving problems. If the duplicated image work, just edited it so it shows the actual image you want.
Regards,
Phillip
------------------------------------------------------------------------
Phillip Piper www.bigfoot.com/~phillip_piper phillip.piper@gmail.com
A man's life does not consist in the abundance of his possessions
|
|
|
|
|

|
Excellent. Glad to hear
|
|
|
|

|
I have use this control for times, and when I update the dll from 2.4.0 to 2.5.1, it looks some stranges:
If you use TreeListView, and set like these:
treeListView1.CheckBoxes = true;
OLVColumn col = new OLVColumn();
col.TextAlign = HorizontalAlignment.Right;
treeListView1.Columns.Add(col);
In 2.4.0, whatever you set the TextAlign property, the check box stay on the left,then icon and text.
In 2.5.1, the check box will stay on the right, but both the icon and text still on the left.
modified 28 Mar '13 - 13:02.
|
|
|
|

|
Let me start by thanking you for this wonderful control and second by appreciating you for your patience on some harsh comments. I want to filter the filtered results. For example after searching "x" from list I got 13 results. And from these 13 results, I want to filter "s". Any trick or help.
I wonder if there is any adjustment for Text Highlighter for RightToLeft languages. Because while highlighting text for right to left languages, control start highlighting text from left side of text. For example one wants to search for "ار" from a word "اردو", control should highlight "ار", but instead of "ار" it highlights "دو".
modified 26 Mar '13 - 15:04.
|
|
|
|

|
You've got a couple of options. An ObjectListView has two members which deal with filtering: olv.ListFilter and olv.AdditionalFilter. You could use these two together to indicate your primary and secondary filters (be they the same or different type of filter). A second alternative is, if you want unlimited levels of filtering, to use a CompositeFilter. This will join any number of filters and apply them together. The filters don't even need to be of the same type. In particular, there is a CompositeAllFilter, where a model object needs to satisfy ALL contained filters to be included in the list.
I'm afraid I don't have any immediate help for the right-to-left text highlighting, but you could try poking around the OLV source code in Renderer.cs. Look for the HighlightTextRenderer's render methods. It looks like it's basically drawing a box around the text, starting from the left, up to the size of the matched text. If you can somehow pass this function a parameter telling it whether to start from the left or right, you can probably get it to do what you want. Alternatively, if your application will only be used in a right-to-left language, you could modify the function always to start from the right, build it, and use the modified DLL in your project.
Hope that helps.
|
|
|
|

|
Thanks for your both precious answers. That really helped. I think it is good to add a property in OLV for RightToLeft highlighting at least. When one is using OLV in RightToLeft layout, definitely he need highlighting in RightToLeft as well. Alternatively programer can detect, in which language user is typing and can use RightToLeft highlighting property. It would be great help for beginners like me. Thanks once again.
|
|
|
|
|

|
Hello.
First of all congratulate you on the great control that has placed at our disposal, is exceptionally good.
Second, how can edit the value of a cell from the code, ie, without user intervention?, In my case I have to go through the list and according to the value of a cell to change the value of another.
Thanks in advance
pd. Sorry for my English, isn´t very good
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
An easier to use ListView that supports sorting, grouping, editing, overlays, and drag-n-drop.
| Type | Article |
| Licence | GPL3 |
| First Posted | 17 Oct 2006 |
| Views | 2,561,203 |
| Downloads | 77 |
| Bookmarked | 1,540 times |
|
|