cxgrid master / detail locate?

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
Kullanıcı avatarı
skyking
Üye
Mesajlar: 136
Kayıt: 09 Kas 2005 12:52
Konum: Antalya

cxgrid master / detail locate?

Mesaj gönderen skyking »

slm arkadaslar

bir gunum cxgrid master / detail gridde
detial la locate yada focus yapmak için google aramadıgım yer kalmadı

master gride komunlanabiliyorum ama detial konumlanamadım.

detial focus yapan bir komut varmı?

cıldırttı beni :evil:

yardımlarınız bekliyorum


master için kod

Kod: Tümünü seç

var
  R,rx: TcxCustomGridRecord;
begin

  cxGrid1x.BeginUpdate;
  try
    TcxGridDBTableView(cxGrid1.FocusedView).DataController.BeginUpdate;
    TcxGridDBTableView(cxGrid1.FocusedView).DataController.LocateByKey(2);
     R := cxGrid1x.Controller.FocusedRecord;
    TcxGridDBTableView(cxGrid1.FocusedView).DataController.EndUpdate;
    cxGrid1x.ViewData.Records[R.Index].Expanded := True;


// detail focus ?


  finally;
    cxGrid1x.EndUpdate;
end;

Kullanıcı avatarı
skyking
Üye
Mesajlar: 136
Kayıt: 09 Kas 2005 12:52
Konum: Antalya

Mesaj gönderen skyking »

arkadaslar yorum bekliyorum kitlendim 2 gundur?
Kullanıcı avatarı
skyking
Üye
Mesajlar: 136
Kayıt: 09 Kas 2005 12:52
Konum: Antalya

Mesaj gönderen skyking »

arkadaslar belki işinize yarar

2 gundur arastırdım ve azmin sonu zafer oldu..

Kod: Tümünü seç

procedure TForm1.ToolButton2Click(Sender: TObject);
var
  R,rx: TcxCustomGridRecord;
  i:integer;
  RecordIndex, RecordId: integer;
  tmpDataCont2, tmpDataCont3: TcxCustomDataController;
  DetailDataController : TcxCustomDataController;
  DetailTableView      : TcxGridTableView;
  Index, RelIndex      : Integer;
  ScM, ScD          : Integer;
begin
  cxGrid1.SetFocus;
  cxGrid1x.BeginUpdate;
  try
    dm.rezer.refresh; //master grid refresh;
    dm.rezkay.refresh; //detail grid refresh;
    if masteritem=0  then begin {masteritem:integer ve master gridde cell de masteritem:=cxGrid1x.DataController.DataSource.DataSet.fieldbyname('id').asinteger;}
    cxGrid1x.DataController.GridView.ViewData.Records[0].Focused:=true;
    exit;
    end;
//master gridde id locate ve focus olmak
    TcxGridDBTableView(cxGrid1.FocusedView).DataController.BeginUpdate;
    TcxGridDBTableView(cxGrid1.FocusedView).DataController.LocateByKey(masteritem);
     R := cxGrid1x.Controller.FocusedRecord;
    TcxGridDBTableView(cxGrid1.FocusedView).DataController.EndUpdate;
    cxGrid1x.ViewData.Records[R.Index].Expanded := True;
    if detialindex='' then exit; { detialindex:integer en son detail de hangi record.index tıklandı detail grid cell de detialindex:=ACellViewInfo.GridRecord.Index;}
    if not cxGrid1x.ViewData.Records[R.Index].Expanded then exit;
    Index                := cxGrid1x.ViewData.Records[R.Index].RecordIndex;
    RelIndex             := cxGrid1x.ViewData.Records[R.Index].ViewData.DataController.GetDetailActiveRelationIndex(Index);
    DetailDataController := cxGrid1x.DataController.GetDetailDataController(Index, RelIndex);
    DetailTableView      := TcxGridTableView(TcxGridDBDataController(DetailDataController).Controller.GridView);
    DetailTableView.ViewData.Records[detialindex].Selected:=true;
  finally;
    cxGrid1x.EndUpdate;
end;
kolay gelsin
Kullanıcı avatarı
DarkEternal
Üye
Mesajlar: 158
Kayıt: 19 Eki 2005 11:00

Mesaj gönderen DarkEternal »

O sroun şu şekildede çözümlenio
master ve detail tabloları tableview de keyfield ten bağlama yaptığınız yerde tüm alanları doldurursanız bu problem çözülmüş oluyo
Kullanıcı avatarı
skyking
Üye
Mesajlar: 136
Kayıt: 09 Kas 2005 12:52
Konum: Antalya

Mesaj gönderen skyking »

tamam olarak sizi anlıyamadım biraz acarmısınız?
ben focus olmadan bahsediyordum yani ilgili master ve ilgi detail gridin row u şeçmek
Kullanıcı avatarı
veliadiguzel
Üye
Mesajlar: 197
Kayıt: 09 Tem 2003 02:11
Konum: Gebze/Kocaeli
İletişim:

Re: cxgrid master / detail locate?

Mesaj gönderen veliadiguzel »

arkadaşım buradaki cxgrid1 ile cxgrid1x arasındaki bağlantı ne tam olarak anlayamadım

viewtopic.php?f=2&t=25471

bende aynı sorundan muzdaribim de bende biraz daha seviye fazla.

teşekkürler.
Veli ADIGÜZEL
Cevapla