winforms - Get child rows from UltraGrid -
i have master/details relation in ultragrid. , want show child rows in new ultragrid when user click on row. how can do? thanks
you handle afterrowactivate or afterrowselected events of first grid , either populate second grid appropriate data. if have data of parent rows in second grid can set column filter apropriatly this:
private void ugparent_afterrowactivate(object sender, eventargs e) { if (this.ugparent.activerow != null) { //either populate grid data specific current row: //this.ugchilds.datasource = this.getchilddata(this.ugparent.activerow); //or filter grid object key = this.ugparent.activerow.cells["idfield"].value; this.ugchilds.displaylayout.bands[0].columnfilters["relationfield"].filterconditions.add(filtercomparisionoperator.equals, key); } else { //clear child grid if required. if set datasource null loose layout , need relayout grid on next binding } }
if use columnfilters remember reuse existing filters or clear filter conditions prior adding new filter conditions.
Comments
Post a Comment