Hi,
I 've got a string grid with 3 columns. First column is fixed and by using other two columns i need to enter values to the grid. In runtime the string grid will be having only one row apart from the fixed row ( which has the titles) . I want to add a row when ever the time user starts writing in the current row. I have written the code as below:
If ( (MYStringGrid.RowCount-FilledRowCount) = 1 ) AND(MYStringGrid.RowCount-1 < MaxPoints) Then
Begin
MYStringGrid.RowCount := MYStringGrid.RowCount + 1;
MYStringGrid.Cells[0, MYStringGrid.RowCount-1] := IntToStr( MYStringGrid.RowCount-1 );
End;
Filled Row Count is the seperate function which i have defined in order to count the filled rows in the grid.
My coding works fine when ever the time i finish entering values to the 2nd column and when i get exit from the 2nd column to the 3rd column it will display a new line. But if in case user enters values in the 3rd colum first and tries to enter values in the 2nd column afterwards it will not display the new line as i expect.
Does anyone know how to do that? Pls that will be a big help for me.
Thanks for your help![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Sanjna...
I 've got a string grid with 3 columns. First column is fixed and by using other two columns i need to enter values to the grid. In runtime the string grid will be having only one row apart from the fixed row ( which has the titles) . I want to add a row when ever the time user starts writing in the current row. I have written the code as below:
If ( (MYStringGrid.RowCount-FilledRowCount) = 1 ) AND(MYStringGrid.RowCount-1 < MaxPoints) Then
Begin
MYStringGrid.RowCount := MYStringGrid.RowCount + 1;
MYStringGrid.Cells[0, MYStringGrid.RowCount-1] := IntToStr( MYStringGrid.RowCount-1 );
End;
Filled Row Count is the seperate function which i have defined in order to count the filled rows in the grid.
My coding works fine when ever the time i finish entering values to the 2nd column and when i get exit from the 2nd column to the 3rd column it will display a new line. But if in case user enters values in the 3rd colum first and tries to enter values in the 2nd column afterwards it will not display the new line as i expect.
Does anyone know how to do that? Pls that will be a big help for me.
Thanks for your help
Sanjna...