Wednesday, March 7, 2012

Custom dataflow component: How do you make properties editable?

I have a custom component that takes in unicode stream and converts it to ascii text. However I would like to make my default string length and code page editable in the standard GUI editor. Right now I can set the default to 1000 characters, but when I try to change it, it says "Property value is not valid"

Any ideas?

Thanks!

I assume you define your property in ProvideComponentProperties? Can you post the code just to be clear?

By default this is all you need to do, the property should then be listed in teh Advanced UI and also in the Visual Studio designer property grid. You would have to do some extra special stuff to make it read-only.

I would check the data type of your property and see what value you have entered, it maybe a simple data conversion issue. To be sure of the property type I woudl view the package XML and find your property and look for the dataType. When you define properties in code, there is no way to really specify the type, it is kind of guess work based on the default value, and it does get it wrong sometimes.

Some package XML to illustrate where you should look...

blah...blah...

<component id="174" name="Your Component Name" componentClassID=.......>

<properties>

<property id="175" name="Your Property" dataType="System.Int32 CHECK THIS"....

No comments:

Post a Comment