|
想要根据多选选中的记录进行过虑筛选,怎么取不到数据的??如图
我选择了3条记录,,可以是memo里面怎么老是只有一条记录??
请帮忙看下那里处问题了??
代码如下:
myform := TDJLSX.Create(self.Context);
try
if DataGrid1.SelectedCount > 0 then
with DataGrid1.DataSource.DataSet do
for i := 0 to DataGrid1.SelectedCount - 1 do
begin
Bookmark := DataGrid1.SelectedRows;
for j := 0 to FieldCount - 1 do
begin
if (j > 0) then s := s + ', ';
s := s + Fields[j].AsString;
end;
Bookmark := DataGrid1.SelectedRows.ToString; //标签记录
GotoBookmark(GetBookmark);
s := DataGrid1.FocusedField.AsString;
end;
myform.Label1.Caption := '按'+DataGrid1.FocusedField.DisplayName+'进行筛选:';
myform.Memo1.Lines.Text := DataGrid1.FocusedField.AsString;
if myform.ShowModal = business.Forms.Controls.mrOk then
begin
DataSetSFKSJJ.SQLFilter := ' '+DataGrid1.FocusedField.FieldName+' = '''+myform.Memo1.Lines.Text+'''';
DataSetSFKSJJ.SQLFiltered := true;
end;
finally
myform.Free;
end;
end;
|
|