stringgrid

Delphi XE5 FireMonkey TstringGrid cells don't accept keyboard input

旧街凉风 提交于 2020-01-15 15:57:30
问题 I am using a TStringGrid which is placed on a popup (TPopup). when the user click a button the popup will appear with the stringGrid. user will then insert some data in the cells then clicking an apply button on the popup which will update a data array. the popup is used as a metro style flyout as per firemonkey sample. the problem is that the string grid appears put when trying to edit a cell it doesn't accept any input from the key board. Any idea how to solve this problem. I am using

Fmx TStringGrid row color

℡╲_俬逩灬. 提交于 2020-01-04 05:49:07
问题 I have a problem in Delphi 10.1 in a multi-device application (on Windows). I have a StringGrid (connected to a db) and I can change background color of row, but the problem is there is a "padding" (in grey/silver) between cells. In onformCreate I define: stringgrid1.DefaultDrawing := False; This is my code: procedure Tlist_form.StringGrid1DrawColumnCell(Sender: TObject; const Canvas: TCanvas; const Column: TColumn; const Bounds: TRectF; const Row: Integer; const Value: TValue; const State:

Font Color on a StringGrid with firemonkey

爱⌒轻易说出口 提交于 2019-12-13 02:14:17
问题 I'm changing the background color based on the data but it makes my text hard to read so I need to change the font color (to white if I have a darker color) but I can't find a way to do it, I'm using Delphi XE8. if not (isSelected) then begin case StrToInt((Sender as TStringGrid).Cells[0, Row]) of 0: begin //TTextCell(CellCtrl).StyledSettings := []; TTextCell(CellCtrl).FontColor := Cores[3 - auxCor - 1]; RowColor.Color := Cores[auxCor-1]; end; 1: begin //TTextCell(CellCtrl).StyledSettings :=

Delphi XE4 stringgrid selectcell in FireMonkey

给你一囗甜甜゛ 提交于 2019-12-11 01:21:09
问题 Does anyone know how to retrieve the column and row when selecting a cell in a FireMonkey stringgrid (in other words, when clicking on a cell, we want to know which column/row is being selected)...? We are using Delphi XE4. Thanks in advance. 回答1: To get the index of the current Row, use the Selected property. To get the index of the current Column, use the ColumnIndex property. 来源: https://stackoverflow.com/questions/17808168/delphi-xe4-stringgrid-selectcell-in-firemonkey

Delete row in StringGrid- Delphi

别等时光非礼了梦想. 提交于 2019-12-10 21:27:56
问题 I want to make something like that. I have a list in my StringGrid and i want to delete one row by selecting cell and then clicking the button. Then this list should show again in StringGrid without this row. The biggest problem i have with deleting row, i tried whis one procedure but it only deleted row in StringGrid, not in list, i think. procedure DeleteRow(Grid: TStringGrid; ARow: Integer); var i: Integer; begin for i := ARow to Grid.RowCount - 2 do Grid.Rows[i].Assign(Grid.Rows[i + 1]);

Add graphical bar to a StringGrid col

不打扰是莪最后的温柔 提交于 2019-11-29 10:39:47
Using Delphi 2010 and a TStringGrid component, I currently display five filds from a database query. Here is a simplied example of what i am doing //set up the grid procedure TGriddata.FormCreate(Sender: TObject); begin grdMain.Rows[0].commatext:='"One","Two","Three","Four","Five"'; grdMain.ColWidths[0]:= 50; grdMain.ColWidths[1]:= 175; grdMain.ColWidths[2]:= 175; grdMain.ColWidths[3]:= 100; grdMain.ColWidths[4]:= 300; end; //display the data in the grid //note, I am not showing my creation, execution, or destroy of the query procedure TGriddata.load; begin ... grdMain.Cells[0,row]:=

Add graphical bar to a StringGrid col

故事扮演 提交于 2019-11-28 03:50:01
问题 Using Delphi 2010 and a TStringGrid component, I currently display five filds from a database query. Here is a simplied example of what i am doing //set up the grid procedure TGriddata.FormCreate(Sender: TObject); begin grdMain.Rows[0].commatext:='"One","Two","Three","Four","Five"'; grdMain.ColWidths[0]:= 50; grdMain.ColWidths[1]:= 175; grdMain.ColWidths[2]:= 175; grdMain.ColWidths[3]:= 100; grdMain.ColWidths[4]:= 300; end; //display the data in the grid //note, I am not showing my creation,

export delphi stringgrid to excel

半城伤御伤魂 提交于 2019-11-27 23:12:35
I'm trying to export data from a stringgrid in delphi 7 to microsoft excel. I have been using this code to do it: objExcel := TExcelApplication.Create(nil); objExcel.Visible[LOCALE_USER_DEFAULT] := true; objWB := objExcel.workbooks.add(null,LOCALE_USER_DEFAULT); lineNumber := 1; for i:=1 to stringgrid1.rowcount-1 do begin for j:=0 to stringgrid1.ColCount-1 do begin objWB.Worksheets.Application.Cells.Item[i+lineNumber,j+1] := ''''+stringgrid1.Cells[j,i]; end; end; but when the data is big, it takes a very long time to finish. is there other faster way to export data from delphi 7 stringgrid to

export delphi stringgrid to excel

淺唱寂寞╮ 提交于 2019-11-26 21:21:17
问题 I'm trying to export data from a stringgrid in delphi 7 to microsoft excel. I have been using this code to do it: objExcel := TExcelApplication.Create(nil); objExcel.Visible[LOCALE_USER_DEFAULT] := true; objWB := objExcel.workbooks.add(null,LOCALE_USER_DEFAULT); lineNumber := 1; for i:=1 to stringgrid1.rowcount-1 do begin for j:=0 to stringgrid1.ColCount-1 do begin objWB.Worksheets.Application.Cells.Item[i+lineNumber,j+1] := ''''+stringgrid1.Cells[j,i]; end; end; but when the data is big, it