Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
675
Multi-Band Grid / DataSet
posted

I'm trying to display a multi-band ultra grid with 3 levels.

I created a DataSet and 3 tables. I added the relationship for the 1st and 2nd tables. I need to add 2 relationships for the 2nd and 3rd tables.

Level 1 - date

Level 2 - date, fgcodenumber

Level 3 - date, fgcodenumber, ccodenumber

I need Level 2's date to match up to Level 1's date and Level 3's date and fgcodenumber to match up to Level 2's.

 
            this.ds.Relations.Add("DateToFG", this.ds.Tables[0].Columns["DATE"], this.ds.Tables[1].Columns["DATE"], false);
            this.ds.Relations.Add("FGToComp", this.ds.Tables[1].Columns["FGCODENUMBER"], this.ds.Tables[2].Columns["FGCODENUMBER"], false);
            this.ds.Relations.Add("CompToDate", this.ds.Tables[1].Columns["DATE"], this.ds.Tables[2].Columns["DATE"], false);

 

The relationship between the first 2 tables seem to have worked - on the dates matching to its parent is displaying. However in the 3rd table - the correct fgcodenumbers are showing but all dates are showing, regardless.

 

Thanks for any help.

Parents
No Data
Reply
  • 675
    Verified Answer
    posted

    I solved this problem by adding the relation like so:

                ds.Relations.Add("NewRelation",
                                    new DataColumn[] {ds.Tables[1].Columns["date"], ds.Tables[1].Columns["fgcodenumber"]},
                                    new DataColumn[] {ds.Tables[2].Columns["date"],  ds.Tables[2].Columns["fgcodenumber"]}, false);

Children
No Data