我想在dbgrid中把某一bool字段全部显示为复选框,象ACCESS中一样,不用控件,怎么实现?(100分)

  • 主题发起人 主题发起人 mygis
  • 开始时间 开始时间
M

mygis

Unregistered / Unconfirmed
GUEST, unregistred user!
要把这一列全部显示为复选框。最好有示例代码!
 
不用控件没法实现,infopoewr控件:
When a field in your grid can contain only two different values, such as Yes/No, Y/N or On/Off, you can represent the field抯 data with a checkbox. A Windows checkbox is a simple two-state edit control, where it is either checked or unchecked, providing the end-user with a very effective visual indication of the field抯 current state. Changing the type of edit control used to display the data in a grid column to a CheckBox is accomplished via the following steps:

I. Change the Edit Control for this field via the InfoPower Select Fields dialog box:

A. Double-click the grid component to display InfoPower抯 Select Fields dialog box. Make sure the column/field you want to change is listed in the Selected Fields listbox. If the field is not currently selected, double-click the field name in the Available Fields listbox to select it.
B. In the Selected Fields listbox, highlight the name of the field you want to change by clicking on it.
C. Click the Edit Control tab within the Currently Selected Field section of the dialog box to display the field抯 currently selected edit control.

D. Click the drop-down button of the Control Type field and click on CheckBox.

II. Enter values to be assigned to the related table抯 field when the checkbox is checked and unchecked.

A. Enter a value to be assigned to the related table抯 field when the checkbox is checked, in the Value when checked edit box.
B. Enter a value to be assigned to the related table抯 field when the checkbox is unchecked, in the Value when unchecked edit box.

III. Click the OK button of the Select Fields dialog box to close it
 
用ehLib非常好用,我现在都用它[:D]
 
我也觉得EHLIB的DBGridEH好用
 
不用控件没法实现?不会吧!那么控件是怎么做出来的?
还有,ehLib是共享版的,哪儿有下载破解版的?
 
这个控件这么好用,没理由不用吧,事半功倍呀。
到DELPHI窑洞下载罗:
www.51DELPHI.com
 
要想知道那些控件是怎么实现那种效果的,就更应该找那些控件来看看呀
 
我用wwqury新建一calculated字段,双击wwdbgrid,选择control type 为check box。可以
出现复选框,但点击时并不能改变其状态,请教各位,如何改变????
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
后退
顶部