Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Read only item with button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Read only item with button

 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: Read only item with button
    Posted: 06 July 2010 at 2:56am

I have a Column with a button.

But I would like to make the cell read only.

If I set Column.Editable = False the button disappears as well.

 

Set Column = wndTasks.Columns.add(2, "Responsibility", 200, True)

Column.Visible = True

Column.Editable = False

Column.EditOptions.AddExpandButton

Column.EditOptions.GetInplaceButton(0).InsideCellButton = True
 
 

I did try this code;

Set Item = rRecord.AddItem("")
        
        Item.CreateEditOptions
        Item.EditOptions.AddExpandButton
        Item.EditOptions.AllowEdit = False
 
Which did sort of give me what I wanted, but the InplaceButtonDown events fires as soon as I click the cell, rather than the button.
 
 if I set Item.EditOptions.ConstraintEdit = True this still allows me to type into the cell but at least it ignores, and clears the type when you click away.
But still not the best.
 
 
Thanks
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: 06 July 2010 at 7:41am
Hi Mark,
 
 
It isn't possible with ExpandButton, Combo and Spin controls. You could add an ItemControl instead...
 
 
 
Me.ReportControl1.AllowEdit = False
    
    With Me.ReportControl1
        .Columns.Add 0, "Column 1", 100, True
       
        For i = 0 To 5
            With .Records.Add()
                With .AddItem(i)
                    With .ItemControls.AddButton(0)
                        .Alignment = xtpReportItemControlRight
                        .Enable = True
                        .Caption = "..."  'Simulate ExpandButton
                        .SetSize 16, 16
                        .Themed = True
                    End With
                   
                End With
            End With
        Next i
       
        .Populate
    End With
 
 
 
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: 07 July 2010 at 3:42am
Thanks very much Aaron.
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: 07 July 2010 at 10:06am
Hi Mark,
 
Glad it helped you
 
I find it strange though why the other "buttons" can't be set like the ItemControl. Same buttons and same EditOptions but different behaviour...
 
 
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: 08 July 2010 at 4:36am

Hi Aaron.

 

The report control is a beast so say the least, really great control, but it's sometimes hard to work with ( My fault)

While I was struggling with this posts problem I tried a different way to solve it.

I would store the column that was clicked in the RequestEdit event

lngSelectedCol = Column.Index

Then in the PreviewKeyDown event set KeyCode = 0 if the column matched the column I wanted to disable typing.


If lngSelectedCol = W_RESPONSIBILITY Then
    KeyCode = 0
End If

 

This worked just great until I showed a modal form when clicking the button.

When the code returns, from the closure of the modal form, the report control PreviewKeyDown does not work anymore.

I tried to create a demo of this problem but can't replicate it outside of my main app.

 

The report control in on a form which is then part of a docking pane.

 

But never mind as its solved another way now.

 

 

All the best

 

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.203 seconds.