Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with a string grid behaviour

Status
Not open for further replies.

sanjna000

Programmer
Aug 1, 2003
132
GB
Hi Guys,
Well I am trying to load data from a .txt file to my string grid. My loading data function works fine. But when i am trying to delete rows in the string grid , it behaves abnormally. Usually in my string grid, if i am trying to delete a row, for instance i ;ve got altogether 4 rows in my string grid and i am trying to delete the 3rd row by deleteing values entered in the 3rd row columns, then third row will be deleted permenently and the fourth row will come to the position of the third row.But after loading data if i am trying to delete the third row then fourth row also will be dissapeared along with the third row. If i am trying to enter values to the third row only it will make visible my fourth row. ( Note: Please make sure for the time been the string grid can have maximum 4 number of rows apart from the title row. so that this problem occurs whenever the time i am trying to delete the last row). I have done this coding in my string grid onselectcell event. Does any one know how to solve this problem?

Many Thanks
Sanjna..
 
Sorry about that Weez...

Begin
DeletePoint( ARow-1 );
For i:= ARow To myStringGrid.RowCount-1 Do
myStringGrid.Rows.Assign(myStringGrid.Rows[i+1]);
myStringGrid.cells[1, myStringGrid.RowCount-1] := '';
myStringGrid.cells[2, myStringGrid.RowCount-1] := '';
myStringGrid.RowCount := myStringGrid.RowCount - 1;
End;

Sanjna...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top