.DefaultValue issues |
Post Reply |
Author | |||
Josef
Groupie Joined: 15 April 2006 Status: Offline Points: 59 |
Post Options
Thanks(0)
Posted: 13 October 2008 at 8:35pm |
||
Hello,
.Value = Variant .Defaultvalue = String Both properties should contain the same vartype (Variant). With PropertyItemEnum, DefaultValue contains the text instead of the selected data value. This makes it impossible to compare "if .Value <> .DefaultValue then ...". Please fix this issues in the next version. A new property ".ValueChanged" would be nice too. Thank you, Josef |
|||
Product: Xtreme SuitePro ActiveX v13.2.1
Platform: Windows 2008 (64bit) Language: Visual Basic 6.0 |
|||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
||
Hi,
|
|||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|||
Josef
Groupie Joined: 15 April 2006 Status: Offline Points: 59 |
Post Options
Thanks(0)
|
||
Hi Aaron,
the problem is this (on German windows):
Hope you can see the problem now. Thank you, Josef |
|||
Product: Xtreme SuitePro ActiveX v13.2.1
Platform: Windows 2008 (64bit) Language: Visual Basic 6.0 |
|||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
||
Hi,
In someway your code doesn't work and that is strange??? You would expect that it would work.
I tried it with your code and failed, but you can do it like this:
cmdSave.Enabled = IIf((Item.Value <> Item.DefaultValue), True, False)
This will work and that's why I wondered why you said you couldn't compare both values.
|
|||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|||
Josef
Groupie Joined: 15 April 2006 Status: Offline Points: 59 |
Post Options
Thanks(0)
|
||
Hello Aaron,
Of course it is strange, if my code does not work ! My code would work, if this description of Defaultvalue in SymbolReference.chm would be true: "The DefaultValue is the value provided when the item was added with the AddChildItem method." This is not true, because the value added with AddChildItem is a variant datatype, but Defaultvalue is string. BTW: Your code snippet would have the same problem as my sample code To make it work, you have to convert .Defaultvalue to Variant:
So you have to write different code for each ItemType, instead of just using
Please try this real life sample (I think it addresses the same problem):
1. Although the value added with AddChildItem is 5, the preselected Combobox-Item is the third " All Users" item (35). 2. How would you set cmdSave.Enabled in ValueChanged event, if user selects another " All Users" item? Defaultvalue contains string " All Users" instead of variant 5. Please think about this issue again, hope I can change your mind. Thank you, Josef |
|||
Product: Xtreme SuitePro ActiveX v13.2.1
Platform: Windows 2008 (64bit) Language: Visual Basic 6.0 |
|||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
||
Hi,
OK, now I know what you mean. Return values of items in ValueChanged event always return string and not the type as assigned to it. I tested your issue with PropertyItemString and it worked, but after testing with different types I have to say this doesn't work at all. Most types will work when comparing the Item.Value with Item.DefaultValue, but most isn't good enough
Note: I didn't test PropertyItemOption and PropertyItemEnumFlags Conlusion: You have to put a lot of effort into it to compare Value and DefaultValue to make it right.
My advice would be adding a property ValueChanged (Read/Write) for propertygrid items, in this case we would only have to check this property and not a lot of coding just to compare both values. There's a property HighlightChangedItems so PropertyGrid control already knows the Item.Value has been changed. So it wouldn't be hard to implement this feature
Thanks a lot
|
|||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|||
Josef
Groupie Joined: 15 April 2006 Status: Offline Points: 59 |
Post Options
Thanks(0)
|
||
Aaron,
Thank you for testing. A new event would help a little, but does not solve the whole problem: In the Save-code of an option dialog, you will have the same problem: To know which item was changed by enumerating all items. But again, you can't do this without writing code for each itemtype. A property .ValueChanged would help, but the best solution would be if .Defaultvalue and .Value containts the same variable type (Variant) and .Defaultvalue contains the value added by .AddChildItem and nothing else. Currently I'm using the .Tag (=variant type) property to store the Defaultvalue and compare .Tag with .Value to see if the item was changed. But in fact, this would not be necessary if DefaultValue would work as described in helpfile. Thank you, Josef |
|||
Product: Xtreme SuitePro ActiveX v13.2.1
Platform: Windows 2008 (64bit) Language: Visual Basic 6.0 |
|||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
||
Hi,
If CJ would add ValueChanged property for PropertyGridItem and Item.Value would be changed (new) ValueChanged property flag would be true and we don't have to compare the values anymore. I think this would be better than changing return values (think about previous versions in which other users have build their "workarounds" to get this working like you now )
|
|||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
||
Hi,
CJ could make HighlightChangedItem public and we could use this to check if the value has been changed
Thanks in advance
|
|||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
||
Oleg??? Could this be possible in next releases?
|
|||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|||
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
||
Added to my TODO list. :)
|
|||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
||
Hi Oleg,
Is this option removed from TODO list and added to Beta release?
I really hope so because I'm really desperate...
Thanks a lot in advance
|
|||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|||
sforces
Groupie Joined: 13 May 2009 Status: Offline Points: 71 |
Post Options
Thanks(0)
|
||
I third this request.
I'm converting to CJ PropertyList from another PropertyList and am finding this would RRRREEEALLLY make things a whole lot simpler as Araron and Josef have already pointed out. It's been 5 months since your last response. Can you please update on when this will be included?
|
|||
Josef
Groupie Joined: 15 April 2006 Status: Offline Points: 59 |
Post Options
Thanks(0)
|
||
Hello CJ-Team,
I'm really impressed that you were not able to change the type of .DefaultValue from String to Variant within the last year . You did this change on ListBox/ComboBox .ItemData method in 13.2, why not on PropertyGrid.DefaultValue?? Bye, Josef |
|||
Product: Xtreme SuitePro ActiveX v13.2.1
Platform: Windows 2008 (64bit) Language: Visual Basic 6.0 |
|||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |