This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi
I downloaded the trial version. I am working on a large project solution consists of many c#/WPF projects under VS 2008. I referenced the assembly in the main UI project and created a new WPF control called MyWPFPropertyGrid, contains the WPFPropertyGrid. I double checked that I have got the correct licenses.licx generated by VS 2008. In some other class, I initialize MyWPFPropertyGrid using: MyPropertyGrid myGrid = new MyPropertyGrid(); myGrid.Show();
However, during the InitializeComponent() call in MyPropertyGrid class the invalid license exception came up: System.ComponentModel.LicenseException
The strange thing is if I create a fresh WPF project under VS2008 and use the same licenses.licx file, th app starts up like a charm.
Anything I did is not quite right?
Thanks |
|
|
Could you check that the BuildAction of the licenses.licx file in the problematic project is set to Embedded Resource? |
|
|
Thank Ivan, I checked the build action for licenses.licx is set to Embeded Resource. |
|
|
And you are still seeing the error? In that case I am not sure what the problem is. If you can send me a project that reproduces the problem then I will have a look at it. You said your main project is quite large and that a fresh project doesn't exhibit the problem, but are you able to create a stripped-down version of the project that's erroring? (You can use the Options tab to attach a zip file to a message here.) |
|
|
Hi Ivan, I have finally got it working... The license file has to be copied into the properties fold of the startup application instead of my project folder. |
|
|
Glad to hear the licence issue is sorted. Regarding TypeConverterAttribute, yes, this is supported. However, it doesn't happen automatically. The reason is that the job of a TypeConverter is to convert between strings and other types. Therefore the TypeConverter only gets invoked if the grid is presented with a string and has to figure out how to convert it to your type. The grid doesn't currently default to a string representation for custom types, even if they do have the TypeConverterAttribute; instead it defaults to the "expandable object" style. So to get the grid to invoke the TypeConverter, we need to tell it to use a string representation. The way to do this is to declare a PropertyEditor for the relevant property, and set the EditorTemplate to the SimpleTextEditorKey: <ms:PropertyGrid.Editors> I'm going to add "automatically detect TypeConverterAttribute and default to string representation if present" to the wishlist; let me know if this is a priority for you. Ivan |
|
|
Hi, i have the same problem as descibed in this thread, but I cant't solve it. The error message:
I tried the thing with the Embedded Resource, but I'n not sure if I did everything right. Could it be a problem of the trial I downloaded?
Thanks for your help Stefanie |
|
|
Hello Stefanie, Have a look at http://www.mindscape.co.nz/forums/Thread.aspx?ThreadID=1309 (written from the point of view of the property grid, but should apply to Elements too). Since you're using Elements, one other possible issue is that Visual Studio may not create all the required entries in licenses.licx. Again, the way to get around this is to copy the licenses.licx from one of the sample projects. If none of these steps/solutions help, could you zip up a project
that reproduces the problem and post it for us to look at? You can
attach files via the Options tab. Thanks! |
|
|
Hi Ivan, using the copying trick made everything work Thanks. |
|