Frequently Asked Component Specific Questions
Options |
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>
TAdvStringGrid
Copy a row with cell values & properties from one grid to another grid
Copy a row with cell values & properties from one grid to another grid
This code snippet that can be applied to two default TAdvStringGrid instances shows how all cell values & cell properties within a rectangle can be copied from one grid to another grid via a memory stream:
procedure TForm4.FormCreate(Sender: TObject); var st: TMemoryStream; begin advstringgrid1.Colors[1,1] := clred; advstringgrid1.Colors[2,1] := clYellow; advstringgrid1.RandomFill(false,100); st := TMemoryStream.Create; try advstringgrid1.SaveRectToBinStream(Rect(0,1,advstringgrid1.ColCount - 1, 1), st); st.Position := 0; advstringgrid2.LoadAtPointFromBinStream(Point(0,1),st); finally st.Free; end; end;