DevExpress_DBcxTreeGrid, 新建记录时老是跳到第一条

开始以为没有进行ParentKey的设置,后来设了ParentKey也一样有问题.

后来无意中将DataSet进行了Post发现OK了

Self.cdsMain.Append;
if s <> '' then
  Self.cdsMain.FieldByName('FParentIndex').AsInteger := StrToInt(s);
Self.cdsMain.FieldByName('FIndex').AsInteger := 0;
Self.cdsMain.FieldByName('FParentCaption').AsString := s1;
self.cdsMain.Post;  //如果没有这句会跳到第一条

posted @ 2009-09-09 10:03  D10.天地弦  阅读(204)  评论(0编辑  收藏  举报