![]() |
Item value (Bug) |
Post Reply
|
| Author | |
markmark
Senior Member
Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
Quote Reply
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? |
|
|
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 |
|
![]() |
|
Aaron
Senior Member
Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
Quote Reply
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.... |
|
![]() |
|
markmark
Senior Member
Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
Quote Reply
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. |
|
|
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 |
|
![]() |
|
Aaron
Senior Member
Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
Quote Reply
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.... |
|
![]() |
|
markmark
Senior Member
Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Aaron
Senior Member
Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
Quote Reply
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.... |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Aaron
Senior Member
Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
Quote Reply
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.... |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Aaron
Senior Member
Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
Quote Reply
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.... |
|
![]() |
|
markmark
Senior Member
Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
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 |