Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Grid checkbox
Mon, Sep 24 2012 12:32 PMPermanent Link

Eric Schwarz

Avatar

How does one specify the value that causes a grid checkbox to be checked?  I've tried data values of Y, T, and 1 to no avail.

---
Eric Schwarz
Mon, Sep 24 2012 12:53 PMPermanent Link

Raul

Team Elevate Team Elevate

Assuming the cell is selected the this would toggle the value

  with Grid1 do
  begin
    if Cells[ColumnIndex,RowIndex] = 'False' then
      Cells[ColumnIndex,RowIndex] := 'True'
    else
      Cells[ColumnIndex,RowIndex] := 'False';
  end;

Raul


On 9/24/2012 12:32 PM, Eric Schwarz wrote:
> How does one specify the value that causes a grid checkbox to be checked?  I've tried data values of Y, T, and 1 to no avail.
>
> ---
> Eric Schwarz
>
Mon, Sep 24 2012 1:47 PMPermanent Link

Eric Schwarz

Avatar

The grid is readonly and not editable.  I just want to display checks based on the data for that column.  Does it need to be a boolean field?  Right now it's a char(1) with 2 possible values, C or B and I want it to be checked if it's a C.  If it were a Delphi TdbCheckBox you would set property ValueChecked to "C".

---
Eric Schwarz
Mon, Sep 24 2012 2:00 PMPermanent Link

Raul

Team Elevate Team Elevate

Read-only and not editable is fine - you can still check it from code.

AFAIK the grid checkbox is boolean at this time and there is no
valuechecked support

Raul




Raul

On 9/24/2012 1:47 PM, Eric Schwarz wrote:
> The grid is readonly and not editable.  I just want to display checks based on the data for that column.  Does it need to be a boolean field?  Right now it's a char(1) with 2 possible values, C or B and I want it to be checked if it's a C.  If it were a Delphi TdbCheckBox you would set property ValueChecked to "C".
>
> ---
> Eric Schwarz
>
Mon, Sep 24 2012 2:12 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Eric,

<< The grid is readonly and not editable.  I just want to display checks
based on the data for that column.  Does it need to be a boolean field?
Right now it's a char(1) with 2 possible values, C or B and I want it to be
checked if it's a C.  If it were a Delphi TdbCheckBox you would set property
ValueChecked to "C". >>

You can still programmatically modify cells when the grid is read-only.
Only the user can't modify the cells.

And yes, it must be a Boolean "True" or "False" value, at least for now.

Finally, in addition to Raul's suggestion, you can also set column values
(as strings) for the current row using the TGridColumn Value property:

http://www.elevatesoft.com/manual?action=viewprop&id=ewb1&comp=TGridColumn&prop=Value

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com




Mon, Sep 24 2012 3:21 PMPermanent Link

Eric Schwarz

Avatar

I fixed it at the source by returning true or false for that column via SQL.

---
Eric Schwarz
Image