Print Page | Close Window

Read only item with button

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=16914
Printed Date: 22 November 2024 at 6:35am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Read only item with button
Posted By: markmark
Subject: Read only item with button
Date 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



Replies:
Posted By: Aaron
Date 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....


Posted By: markmark
Date 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


Posted By: Aaron
Date 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....


Posted By: markmark
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net