Read only item with button |
Post Reply |
Author | |
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
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 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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
|
Thanks very much Aaron.
|
|
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)
|
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.... |
|
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
|
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.
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 |
|
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 |