Re: Adding combobox to grid?
- From: "Burkhard Schneider" <info@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 17 Oct 2006 22:04:50 +0200
"brett" schrieb:
I couldn't find that property but there are similar ones, such as
goColSizing that I've read about. I don't have the IDE in front of me
now but are you saying in the Object Inspector for XStringGrid
properties, I'll see an options property?
Yes, of course. Like every standard StringGrid, also XStringgrid has an
options property. And within the options you find goEditing as well as
goColSizing.
Also, how do I insert a new row at runtime? I've set the rows to 2
(header and one new row).
Perhaps there are better solutions but I increase the RowCount by 1 and copy
the Rows below the 'new' row to one row down. This code insert a new row at
the current cursor position:
....
xg:TXStringGrid;
....
procedure TMyForm.InsertRow;
var aRow,acol:integer;
begin
xg.RowCount:=xg.RowCount+1;
for aRow:=xg.RowCount-1 downto xg.Row+1 do begin
for acol:=1 to xg.ColCount do
xg.Cells[acol,arow]:=xg.cells[acol,arow-1]
end;
for acol:=1 to xg.ColCount do
xg.Cells[acol,arow]:='';
end;
I was thinking it would grow at run time
after I tabbed past the combo box column (my last column).
No. Why should it do so?
If you want this functionallity, you must implement it yourself
Regards
Burkhard
.
- Follow-Ups:
- Re: Adding combobox to grid?
- From: alanglloyd@xxxxxxx
- Re: Adding combobox to grid?
- From: brett
- Re: Adding combobox to grid?
- References:
- Adding combobox to grid?
- From: brett
- Re: Adding combobox to grid?
- From: Burkhard Schneider
- Re: Adding combobox to grid?
- From: brett
- Re: Adding combobox to grid?
- From: Maarten Wiltink
- Re: Adding combobox to grid?
- From: alanglloyd@xxxxxxx
- Re: Adding combobox to grid?
- From: brett
- Re: Adding combobox to grid?
- From: Burkhard Schneider
- Re: Adding combobox to grid?
- From: brett
- Re: Adding combobox to grid?
- From: Burkhard Schneider
- Re: Adding combobox to grid?
- From: brett
- Adding combobox to grid?
- Prev by Date: How to keep IDE preferences?
- Next by Date: Re: How to keep IDE preferences?
- Previous by thread: Re: Adding combobox to grid?
- Next by thread: Re: Adding combobox to grid?
- Index(es):