DataSet当前行,不是当前选中的行
int arow = 0;
arow = cds1->RecNo;
arow = cds1->RecordCount;
arow = DBGridEh1->DataRowToRecNo(DBGridEh1->Row);//接近靠谱
arow = DBGridEh1->TopRow;
arow = DBGridEh1->TopRowOffset;
arow = DBGridEh1->DataRowCount();
arow = DBGridEh1->VisibleRowCount;
arow = DBGridEh1->Row;//接近靠谱
arow = DBGridEh1->RowCount;
当grid下拉滚动条时就不准确了
强制选中当前行:
DBgrid1.SelectedRows.CurrentRowSelected=true;
判断当前行是否选中:
if DBgrid1.SelectedRows.CurrentRowSelected then
showmessage('Selected');
else
'not select';