BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Change DetailClientDataset index, But MasterCDS chaged!!

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Multi-Tier)
View previous topic :: View next topic  
Author Message
hydonlee
Guest





PostPosted: Mon Jul 28, 2003 12:36 pm    Post subject: Re: Change DetailClientDataset index, But MasterCDS chaged!! Reply with quote




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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Multi-Tier) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.