Re: StringGrid,delete last row
As you just want to delete the last row, you can just point your last Row to the Second Last Row - as you have done in your code -
// (2) remove the last row
StringGrid1->RowCount = StringGrid1->RowCount - 1;
Now, what eactly do you want to do for adding a new row?
- add it at the end (use this) ?
const int row_count = StringGrid1->RowCount;
StringGrid1->Rows[row_count] = <your new data>;
StringGrid1->RowCount = row_count + 1;
or,
- add it at the begining?
- by moving/shifting the Rows to downwards and deleting the last row?
- or overwriting the first row and keep the other rows as it is?
Raju2001006
Please put [CODE][/CODE] tags around your code to preserve indentation and make it more readable...
Bookmarks