November 19th, 2012, 05:56 AM
StringGrid,delete last row
I have a small problem with my application. I have an Edit1 from where i put values in StringGrid.
I want to make a button where i will put the above code. with this button the user will delete the last row of the stringgrid.
When he write again on Edit it will put it in the after the last record. I write the above but dont work right. I just want from the user delete the last row
const int row_count = StringGrid1->RowCount;
// (1) shift the contents of the trailing columns
for (int row =1; row < row_count - 1; ++row)
StringGrid1->Rows[row] = StringGrid1->Rows[row + 1];
// (2) remove the last row
StringGrid1->RowCount = row_count -1;
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!