Put a TCheckBox inside a TStringGrid in Delphi

前端 未结 3 1465
猫巷女王i
猫巷女王i 2020-12-13 16:44

I want to put a TCheckBox inside a TStringGrid in Delphi in every cell of certain column. I\'m using Delphi XE.

3条回答
  •  一向
    一向 (楼主)
    2020-12-13 17:09

    I use a virtual grid called ExGridView by Roman Mochalov, that supports checkboxes.

    My own modified fork of GridView, ported for Unicode etc, named TExGridView, instead of TGridView, and with a demo of checkboxes is on bitbucket here as /wpostma/exgridview.

    The ExGridView component has a Checkbox property in the property inspector which must be set true, Then you must set up your Column properties so that the Column has a checkbox type set to checkbox or radio button. Then you must implement the GetCheckState event callback. See the demo included on the bitbucket project.

    The original source for this code was here but it's not buildable on recent versions. My bitbucket version is tested and working with Delphi 2007, 2009, and all versions up to date as of 2016 (Delphi 10 Seattle).

    enter image description here

提交回复
热议问题