Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Property Grid
  New Posts New Posts RSS Feed - Item value (Bug)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Item value (Bug)

 Post Reply Post Reply
Author
Message
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Topic: Item value (Bug)
    Posted: 09 September 2008 at 12:50pm
Item changes all by its self:
 
In my example,
If you change the grid value and click away a message box will show.

But the value displayed in the property grid has now redisplayed the original value.

 

Is this a bug?

 

MArk
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 10 September 2008 at 10:49am
Hi,
 
No it isn't Mark.
 
Not in this event, suppose you would check the entered value and it wouldn't be right, you are able to cancel the change. So the value must be still the same as before changing otherwise you would have to check the old value itself. After this event the value changed event will fire and the value is changed into the entered value. just as you see in your sample when displaying a MessageBox.
 
Hope this helps
 
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....
Back to Top
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 12 September 2008 at 3:30am

Hi

 

Internally the control does store both values, but to the user they have typed into the control a value and it may be that I am displaying a message box that says are you sure you want to set this value, the user look back at what they have typed only to see it back to the original value while the msgbox is displayed.

 

That can’t be correct.

 

Mark
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 12 September 2008 at 4:24am
Hi Mark
 
Now I understand what you mean. If user types something and you display a messagebox, the original value is displayed again and you can't see what you entered. This is one for CJ to fix
 
If you really need this, you can use this workaround and in the meantime CJ can fix this
 
Private Sub pgPropertyGrid_AfterEdit(ByVal Item As XtremePropertyGrid.IPropertyGridItem, NewValue As String, Cancel As Boolean)
    Dim oldVal As String
    Dim newVal As String
   
    oldVal = Item.Value
    newVal = NewValue
   
    pgPropertyGrid.FindItem(Item.Caption).Value = NewValue
    Dim retval As VbMsgBoxResult
    retval = MsgBox("Are you sure you want to change " & oldVal & " into " & newVal & "?", vbOKCancel)
    If retval = vbCancel Then
        Cancel = True
        pgPropertyGrid.FindItem(Item.Caption).Value = oldVal
    End If
End Sub
 
 
 
 
 
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....
Back to Top
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 12 September 2008 at 8:25am
Thanks Aaron.
 
Thats a good workaround.
 
Mark
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 12 September 2008 at 8:41am
Hi Mark,
 
It's nice to have a workaround if you are going to release your application yourself but and it's only temporary...
 
It will do nicely for now, but I expect CJ to fix this in next release
 
 
 
 
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....
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 15 September 2008 at 5:58am
Hi,
AfterEdit don't know if you going to commit this change. Use ValueChanged even instead:
 
Private Sub pgPropertyGrid_ValueChanged(ByVal Item As XtremePropertyGrid.IPropertyGridItem)
MsgBox "A Message"
End Sub
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 15 September 2008 at 7:03am
Hi Oleg,
 
In value change event the value is already set to entered value and checking here I have to know old value and as it behaves now, the value is changed into old value (user doesn't know what value he/she has entered) The workaround I showed could easely be done by you in after edit event. It works OK but don't change value into old value only if cancel = true.
 
Thanks
 
 
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....
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 15 September 2008 at 10:31am
ok :),
btw what point in
pgPropertyGrid.FindItem(Item.Caption).Value = NewValue ?
Why not Item.Value = NewValue
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 15 September 2008 at 10:55am
Hi,
 
Yes, you are correct Oleg,  it's unnecessary
 
For the ones who will use this until Oleg fixes this:
 
Private Sub pgPropertyGrid_AfterEdit(ByVal Item As XtremePropertyGrid.IPropertyGridItem, NewValue As String, Cancel As Boolean)
    Dim oldVal As String
   
    oldVal = Item.Value
    
    Item.Value = NewValue
 
    Dim retval As VbMsgBoxResult
    retval = MsgBox("Are you sure you want to change " & oldVal & " into " & newValue & "?", vbOKCancel)
    If retval = vbCancel Then
        Cancel = True
        Item.Value = oldVal
    End If
End Sub
 
 
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....
Back to Top
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 16 September 2008 at 4:22am
Thanks All
MArk
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.219 seconds.