Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatic checkbox in grid behaving readonly?
Message
From
24/09/1998 01:33:29
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00139976
Message ID:
00140224
Views:
21
>I am experencing the following problem on a VFP 5 project. When the checkbox is added to the grid it behaves as if it is "readonly". Without the checkbox the column is writeable. I have tried many different sequences of property settings without achieving a solution. Any ideas?
>TYIA,
>Robert Baker
>
>select .f. as lbill,fldb from table into cursor cur1
>USE DBF("cur1") IN 0 AGAIN ALIAS cur2
>with thisformset.frmA.grdA
> .recordsource = 'cur2'
> .readonly = .f.
> .columncount = 2
> .Column1.controlsource = 'Cur2.lbill'
> .Column1.readonly = .f.
> .Column1.AddObject('zcb','checkbox')
> .Column1.zcb.caption = ''
> .Column1.sparse = .f.
> .Column1.CurrentControl = 'zcb'
> .Column1.header1.alignment = 2
> .Column1.header1.caption = 'Bill'
> .Column1.header1.FontBold = .t.
> .Column1.width = 32
>
> .Column2.controlsource = 'Cur2.fldb'
> .Column2.header1.alignment = 2
> .Column2.header1.caption = 'ID'
> .Column2.header1.FontBold = .t.
> .Column2.readonly = .t.
> .Column2.width = 50
>endwith

Hi,
Missing piece is a visible = .t. after addobject.
>select .f. as lbill,fldb from table into cursor cur1
USE DBF("cur1") IN 0 AGAIN ALIAS cur2
with thisformset.frmA.grdA
        .recordsource = ""
        .columncount = -1
        .recordsource = 'cur2'
        with .columns(1)
	  .AddObject('zcb','checkbox')
	  .zcb.caption = ''
          .zcb.visible = .t.
	  .sparse = .f.
          with .header1
	    .alignment = 2
	    .caption = 'Bill'
	    .FontBold = .t.
          endwith
	  .width = 32
        endwith
        with .columns(2).header1
	  .alignment = 2
	  .caption = 'ID'
	  .FontBold = .t.
        endwith
	.Columns(2).width = 50
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform