I want to add new entries generated by logs at run time from my software at the bottom of StringGrid widget (20 rows and 2 columns) in C++ Builder 5.
Whether there is any Property of StringGrid widget which can automatically delete entry in top most row before adding new entry in bottom most row in case all rows of fixed size StringGrid is occupied with data.
Please inform me if you need any other information from me.
Many thanks
Saurabh Jain
As I told you in the Embarcadero forums...
There is no public property/method for what you are asking for. You will just have to set/increment the
RowCountproperty as needed, then manually shift up the contents of theCellsproperty, and then finally fill in the bottom row.However,
TStringGriddoes have a protectedDeleteRow()method, but being protected, you need to use an accessor class to reach it, eg:That said,
TStringGridis really not the best choice for what you are trying to do. I would strongly suggest usingTListViewinvsReportmode instead. That is what I use in my log viewer, and it works very well, especially in virtual mode (OwnerData=true), and it just looks more natural thanTStringGrid, sinceTListviewis a wrapper for a native Windows control whereasTStringGridis not.