Board index » cppbuilder » Using StringGrid

Using StringGrid


2005-12-20 11:23:15 PM
cppbuilder88
I want to clear all the items in StringGrid when I exit a tab, I add the
following on a Hide event of the tab
// Clear all fields
for (iRow = 1; iRow <= 16; iRow++)
StringGrid1->Cells[iCol++][iRow] = NULL;
This did not work, so I tried
// Clear all fields for house code A
for (iRow = 1; iRow <= 16; iRow++)
StringGrid1->Cells[iCol++][iRow] = " ";
This did not work, so I tried
// Clear all fields for house code A
for (iRow = 1; iRow <= 16; iRow++)
StringGrid1->Cells[iCol++][iRow] = 0;
This still didn't work? Everytime I opened the tab, the information
previously still exists?
What can I do to corrrect this?
Thank you,
Neil
 
 

Re:Using StringGrid

Hello,
I 'm working with c++Builder5 under Windows X
I 've created a form with a StringGrid Component: (2 Lines 5 cols)
My application has more cells but to explain my problem i simplify
at the creation of the form i initialize the Stringrid Cells
StringGrid1->Cell[0][0]="Text 0-0"
StringGrid1->Cell[1][0]="Text 1-0"
StringGrid1->Cell[2][0]="Text 2-0"
StringGrid1->Cell[3][0]="Text3-0"
StringGrid1->Cell[4][0]="Text 4-0"
StringGrid1->Cell[0][1]="Text 0-1"
StringGrid1->Cell[1][1]="Text 1-1"
StringGrid1->Cell[2][1]="Text 2-1"
StringGrid1->Cell[3][1]="Text3-1"
StringGrid1->Cell[4][1]="Text 4-1"
Ok I create now a report with a stringBand which comes to read cells ot the
stringGrid
I get this by writing in the beforeStringBandprint
Stingband1->Qrlabel1->caption=Cell[1][Stringband1->Index]
Text 0-0 Text 1-0 Text 2-0 Text 3-0 Text 4-0 Text5-0
Text 0-1 Text 1-1 Text 2-1 Text 3-1 Text 4-1 Text 5-1
Ok there is no Prblem
Now If I change values in the STringGrid1 by clickin on a button ; my
StringValues is well displayed but in my report I get the old Values . is-it
a bug (new values wouldn't be refresh at the reading?)
--
AEROPRODUCT
Didier BODINIER
Tel: 02.40.28.51.94
Email XXXX@XXXXX.COM
Rue du 11 Novembre
BP1
44110 SOUDAN
 

Re:Using StringGrid

Are you refreshing the report? A report reads the data when it is
generated and will not reflect changes unless it is recreated.
HTH
Al
www.coolest-gadgets.com
 

{smallsort}

Re:Using StringGrid

Wrong newsgroup section.
.language.cpp deals with issues arising from the C++ language, its
standard libraries and non-visual VCL classes.
Questions such as yours that involve using VCL components belong in
.vcl.components.using
--
Andrue Cope [TeamB]
[Bicester, Uk]
info.borland.com/newsgroups/guide.html