 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
hydonlee Guest
|
Posted: Mon Jul 28, 2003 12:36 pm Post subject: Re: Change DetailClientDataset index, But MasterCDS chaged!! |
|
|
Thanks all, I get it . It is a bug of Delphi 5.
"hydonlee" <hydonlee (AT) hotmail (DOT) com> wrote:
| Quote: |
Hi ALL,
I have a Master-Deail Application Based ClientDataSet by DataSetField;
When I chage the Detail ClientDataSet Index, The Master ClientDataSet Current Record changed, the Proir Record Showed.
Flow is the code:
mIsAsc := not self.GetIndexAsc(cdsBody1); //Want Asc?
if mIsAsc then
begin//Want Asc
cdsBody1.IndexName:='';
cdsBody1.IndexFieldNames:=FBodyOrderField.FieldName ;
end
else
begin//Want Desc?
//cdsBody1.IndexFieldNames:='';
with cdsBody1.IndexDefs do
begin
mIndexPos := -1 ;
for i:= 0 to Count-1 do
begin
if cdsBody1.IndexDefs[i].name=FBodyOrderField.FieldName then
begin
mIndexPos:=i ;
break ;
end;
end;
if mIndexPos>=0 then //Index Exist
begin
cdsBody1.IndexDefs[mIndexPos].Fields := FBodyOrderField.FieldName;
cdsBody1.IndexDefs[mIndexPos].Options := [ixDescending]
end
else
begin //no Index found
//Clear;
with AddIndexDef do
begin
Name := FBodyOrderField.FieldName;
Fields := FBodyOrderField.FieldName;
DescFields := FBodyOrderField.FieldName;
Options := [ixDescending]
end;
end;
cdsBody1.IndexFieldNames:=''; //Master chaged after here.
cdsBody1.IndexName := FBodyOrderField.FieldName ;
end;
end;
PS: the only occur sometime.
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|