Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Checkbox + AllowEdit (Strange Behavour)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Checkbox + AllowEdit (Strange Behavour)

 Post Reply Post Reply
Author
Message
choochy View Drop Down
Groupie
Groupie
Avatar

Joined: 27 October 2006
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote choochy Quote  Post ReplyReply Direct Link To This Post Topic: Checkbox + AllowEdit (Strange Behavour)
    Posted: 29 January 2010 at 8:42pm

I have a report control setup with a couple of columns that I need to be just checkboxs, the rest of the columns are text.

I have enabled editable on the report control and set any columns that I dont want to be editable as false. I have added the checkboxs (using Item.HasCheckbox = True) but this is where the functionality gets strange.
 
The checkbox itself works fine as a checkbox and tickes and untickes, however if u click next to the checkbox (still in the column) it goes in to text editing mode. Example:
 

 
From memory, the previous version didnt work like this. How can stop this behavour? I only want the checkbox to be edited and not the text within.
 
Thanks
 
Chris
Product: Xtreme SuitePro (ActiveX) version 13.4.2
Platform: Windows 7 (32bit)
Language: Visual Basic 6.0 & Delphi XE
Back to Top
@lin View Drop Down
Groupie
Groupie


Joined: 20 September 2006
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote @lin Quote  Post ReplyReply Direct Link To This Post Posted: 23 February 2010 at 11:19am
I am also interested in a way to solve this issue. Any solution? (besides the one to use pictures emulating checkboxes instead of checkboxes)
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 23 February 2010 at 11:42am
If you set ReportControl.EditOnClick = False, does it still happen?

If you provide a small sample, I can experiment a bit to try and find a solution.

One thing I notice is that there is no CancelEdit or FinishEditing method like some other grids I use - this would be nice.

Even nicer would be a BeforeEdit(Cancel As Boolean) event that allows you to prevent editing based on any arbitrary conditions that you may have, but I don't see an event like this either.

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 23 February 2010 at 11:47am
Okay, there is a RequestEdit event, which fires before the edit window appears and allows you to cancel editing. Can you test for your column there and then set Cancel = True?
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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: 23 February 2010 at 2:27pm
Hi,
 
I can't find a workaround and it seems we need a fix for this before new release.
This was working OK in previous versions.
 
Mark, please fix this for V14.0
 
 
 
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
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 23 February 2010 at 3:47pm
IMHO, I think RequestEdit should only fire before the Edit box is going to be shown - that way you could still change the checkbox state, and prevent editing of the cell value by setting Cancel = True.

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 23 February 2010 at 4:12pm
Here's a workaround if you are desperate for something until a proper fix is issued:

General section:

Private Declare Function SendMessageLong Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_CLOSE As Long = &H10


Code (adjust for the name of your reportcontrol as required)

Private Sub ReportControl1_BeginEdit(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem)
   If Item.HasCheckbox Then
      ' Close the cell editor if item has a checkbox
      SendMessageLong Me.ReportControl1.InplaceEditHwnd, WM_CLOSE, 0, 0
   End If
End Sub

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
choochy View Drop Down
Groupie
Groupie
Avatar

Joined: 27 October 2006
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote choochy Quote  Post ReplyReply Direct Link To This Post Posted: 23 February 2010 at 6:30pm
Thanks for the responses guys. Yes I have not seen this problem in previous releases either.
 
While this is not a good work around, I was able to get what I wanted by setting ReportGrid.AllowEdit = False. Lucky for me the only editable items in my lists are checkboxes.
 
I hope that this is fix soon.
Product: Xtreme SuitePro (ActiveX) version 13.4.2
Platform: Windows 7 (32bit)
Language: Visual Basic 6.0 & Delphi XE
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 25 February 2010 at 7:57pm
Originally posted by jpbro jpbro wrote:

IMHO, I think RequestEdit should only fire before the Edit box is going to be shown - that way you could still change the checkbox state, and prevent editing of the cell value by setting Cancel = True.


Cancel = True will cancel any changes made in request edit, so that wont work.

I decided to add Item.CanEditCheckboxItem property to not break existing functionality.  So incase someone actually wants to allow check box items to be edited they will be allowed to.

Set Item.CanEditCheckboxItem = False and you are good to go :)

**edit** I made False the default setting after checking an older version  (12.1.1) and seeing that even with the item set to editable it would not display an edit control.
Back to Top
choochy View Drop Down
Groupie
Groupie
Avatar

Joined: 27 October 2006
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote choochy Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2010 at 6:21am
Excellent. Thanks!
Product: Xtreme SuitePro (ActiveX) version 13.4.2
Platform: Windows 7 (32bit)
Language: Visual Basic 6.0 & Delphi XE
Back to Top
Michael S. View Drop Down
Newbie
Newbie


Joined: 06 October 2009
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michael S. Quote  Post ReplyReply Direct Link To This Post Posted: 16 June 2010 at 4:29am
Just another way to do it, as I just had the same problem. You can also set the column EditOptions like this:

rcCol.EditOptions.AllowEdit = False

This will also allow checkbox editing, but no text editing.
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.172 seconds.