Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 6 of 6 total |
Grid ctCheckBox |
Thu, Aug 6 2015 11:32 PM | Permanent Link |
Trinione | How can the state of a grid column of ControlType ctCheckbox be accessed?
For instance, a user checks 3 checkboxes on the grid. How to find out which 3 they selected? |
Fri, Aug 7 2015 2:00 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | << How can the state of a grid column of ControlType ctCheckbox be accessed? >>
Is this a data-bound grid, or non-data-bound grid ? If it's a data-bound grid, then you can simply read the applicable dataset column. If it's not data-bound, then you can access the value via this property: http://www.elevatesoft.com/manual?action=viewprop&id=ewb2&comp=TGridControl&prop=Rows like this: ShowMessage(MyGrid.Rows[10][MyBooleanColumn.Index]); where 10 is the row to access (0-based). Tim Young Elevate Software www.elevatesoft.com |
Fri, Aug 7 2015 10:36 PM | Permanent Link |
Trinione | Tim:
<< Is this a data-bound grid, or non-data-bound grid ? >> It is a data-bound grid. However, no field exist that I can access a boolean from. I would like to use a checkbox in the left most column to select the rows to work on. For example, ID .| Details [X] 1001 | Database info in Row 1 [ ] 1002 | Database info in Row 2 [X] 1003 | Database info in Row 3 [ ] 1004 | Database info in Row 4 I tried creating a new field in the dataset, but that generates an error when I run and the Dataset object gets messed up and I need to remove and put the Dataset object from the start and reselect the events etc. I the above example, How can I create a checkBox that appears with each databound grid row? I am even trying to create a new 'virtual' column from the EDB database. Can a virtual Boolean field be created with a SELECT query??? That ought to work if its possible. . |
Sat, Aug 8 2015 5:56 AM | Permanent Link |
Trinione | Ok, I figured it out and posting to help others.
>> First create a virtual column in the dataset as type Boolean. SELECT CAST(false AS BOOLEAN) AS chkState, * FROM TableName >> Then, to set procedure Tfrm.Grid1Click(Sender: TObject); begin With DataSet1 do begin Update; Columns['chkState'].AsBoolean := Not Columns['chkState'].AsBoolean; Save; end; end; NOTE, with the upcoming Cell/Column OnClick event the code can be moved there and checked for chkState column being clicked. |
Mon, Aug 10 2015 10:46 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Trinione,
<< I tried creating a new field in the dataset, but that generates an error when I run and the Dataset object gets messed up and I need to remove and put the Dataset object from the start and reselect the events etc. >> What error message did you see ? You should be able to add dataset columns without issue. I just tried it here and it works fine. Tim Young Elevate Software www.elevatesoft.com |
Mon, Aug 10 2015 6:05 PM | Permanent Link |
Trinione | Sorry Tim, I was able to resolve my issue by creating a field in the query and using that. Can't recall the error at this time.
|
This web page was last updated on Wednesday, October 9, 2024 at 05:37 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |