TeeGrid OnTap
-
- Newbie
- Posts: 17
- Joined: Tue Aug 22, 2023 12:00 am
TeeGrid OnTap
How can I work with the const Point: TPointF to determine the row that was tapped?
I am trying to change the selected row when the user taps the grid.
TIA
I am trying to change the selected row when the user taps the grid.
TIA
-
- Newbie
- Posts: 17
- Joined: Tue Aug 22, 2023 12:00 am
Re: TeeGrid OnTap
Really would like a reply to this. It has me stumped.
Re: TeeGrid OnTap
Hello,
Apologies for the delay with the reply. The detail for the information required is found via:
That could source from the x,y of a mousedown/up or the Point of a Tap but we're delayed on getting to the test for the tap.
Regards,
Marc
Apologies for the delay with the reply. The detail for the information required is found via:
Code: Select all
var myColumn : TColumn;
myRow : Integer;
myX; myY: Integer;
begin
//myX := x
//myY := y
myColumn := TeeGrid1.Columns.FindAt(myX,TeeGrid1.Width);
myRow := TeeGrid1.Rows.RowAt(myY,TeeGrid1.Height);
ShowMessage ('Col: ' + IntToStr(myColumn.ID) + ' Row: ' + IntToStr(myRow));
end;
Regards,
Marc
Steema Support
-
- Newbie
- Posts: 17
- Joined: Tue Aug 22, 2023 12:00 am
Re: TeeGrid OnTap
Thanks mcuh! I'll try it out tonight.
-
- Newbie
- Posts: 17
- Joined: Tue Aug 22, 2023 12:00 am
Re: TeeGrid OnTap
This worked very well:
Code: Select all
procedure TFudleyMain.TeeGrid1Tap(Sender: TObject; const Point: TPointF);
var
myRow : Integer;
myX, myY: single;
hgt : single;
begin
myX := point.X;
myY := point.Y;
hgt := TeeGrid1.Height;
myRow := TeeGrid1.Rows.RowAt(myY,hgt);
TeeGrid1.Selected.Row :=myRow;
end;
Re: TeeGrid OnTap
Great, thanks for the feedback.
-
- Newbie
- Posts: 17
- Joined: Tue Aug 22, 2023 12:00 am
Re: TeeGrid OnTap
Unfortunately TeeGrid1.Rows.RowAt only works to row 7. Past that it returns -1, even though there are several rows past that.
-
- Newbie
- Posts: 17
- Joined: Tue Aug 22, 2023 12:00 am
Re: TeeGrid OnTap
I should clarify what I am trying to do.
This is for mobile only. I would like the user to be able to tap on the row they want to move to, and the selected row/record becomes the one tapped on.
Any help you can offer is appreciated.
This is for mobile only. I would like the user to be able to tap on the row they want to move to, and the selected row/record becomes the one tapped on.
Any help you can offer is appreciated.
-
- Newbie
- Posts: 17
- Joined: Tue Aug 22, 2023 12:00 am
Re: TeeGrid OnTap
So is this a bug?
Re: TeeGrid OnTap
Hello,
I've tried it in the CellEditors project (FMX on Windows) with the following co-ordinates;
and it returns correctly, column 2, row 9.
It may be a problem limited to Tap. What mobile devices have you tried?
With thanks.
Regards,
Marc Meumann
I've tried it in the CellEditors project (FMX on Windows) with the following co-ordinates;
Code: Select all
procedure TFormCellEditors.Button1Click(Sender: TObject);
var myColumn : TColumn;
myRow : Integer;
begin
myColumn := TeeGrid1.Columns.FindAt(160,TeeGrid1.Width);
myRow := TeeGrid1.Rows.RowAt(218,TeeGrid1.Height);
It may be a problem limited to Tap. What mobile devices have you tried?
With thanks.
Regards,
Marc Meumann
Steema Support
-
- Newbie
- Posts: 17
- Joined: Tue Aug 22, 2023 12:00 am
Re: TeeGrid OnTap
Hi Marc,
I'm using a Galaxy S10E.
-garry
I'm using a Galaxy S10E.
-garry
-
- Newbie
- Posts: 17
- Joined: Tue Aug 22, 2023 12:00 am
Re: TeeGrid OnTap
Amy ideas on this?
-
- Newbie
- Posts: 17
- Joined: Tue Aug 22, 2023 12:00 am
Re: TeeGrid OnTap
I've attached a small screen shot.
You can see the selected row, and also a light blue rectangle around the cell I just tapped on. So teegrid knows I tapped there since it painted the light blue rectangle, but its just not moving the selection.
Hope this provides a clue to what's happening. I really need this to work, as users on android will expect a tap to change the selection .
Thanks much!
You can see the selected row, and also a light blue rectangle around the cell I just tapped on. So teegrid knows I tapped there since it painted the light blue rectangle, but its just not moving the selection.
Hope this provides a clue to what's happening. I really need this to work, as users on android will expect a tap to change the selection .
Thanks much!
- Attachments
-
- CutPaste_2023-11-17_00-03-43-486.png (130.21 KiB) Viewed 52956 times
Re: TeeGrid OnTap
Hello Garry,
Apologies that you're not getting a quick answer for this. Resource time is being assigned to the issue and hopefully we can get some feedback to you very soon.
Regards,
Marc
Apologies that you're not getting a quick answer for this. Resource time is being assigned to the issue and hopefully we can get some feedback to you very soon.
Regards,
Marc
Steema Support
Re: TeeGrid OnTap
Hello Garry,
This is still checking out ok on tests on a mobile device. In this case a Realme 6 on Android 11.
I can make the test project available if you think it may be useful. It runs 10,000 lines and marks the selected row as an arrow at row beginning. I put a label in to confirm the selected row.
It reports badly only for the last row on a visible screen where the row is not complete. In this case it returns a -1.
Using RAD Studio 12 with TeeGrid v1.14.
Apologies once again for taking so long to get here.
Regards,
Marc
This is still checking out ok on tests on a mobile device. In this case a Realme 6 on Android 11.
I can make the test project available if you think it may be useful. It runs 10,000 lines and marks the selected row as an arrow at row beginning. I put a label in to confirm the selected row.
It reports badly only for the last row on a visible screen where the row is not complete. In this case it returns a -1.
Using RAD Studio 12 with TeeGrid v1.14.
Apologies once again for taking so long to get here.
Regards,
Marc
Steema Support