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
1775
Ultrawingrid multiple bands
posted

Hi guys

I have a valid dataset with 3 tables that im wanting to display in my ultrawingrid. The tables are related.

Can someone please explain step for step on how to get my 3 tables to appear im my grid?

i can populate a grid with 1 table no problem.

do i have to use the ultra datasource to get this to work? if so how?

Parents
  • 53790
    Suggested Answer
    posted

    Hello Birmo,

    One possible way to achieve desired behavior could be if you set Relation between tables in your DataSet. For example:

    DataSet ds = new DataSet();

     

    DataTable dt = new DataTable();

    dt.Columns.Add("ID", typeof(int));

    dt.Columns.Add("Col 1", typeof(string));

    dt.Columns.Add("Col 2", typeof(string));

    dt.Columns.Add("Col 3", typeof(int));

     

    DataTable dt2 = new DataTable();

    dt2.Columns.Add("PID", typeof(int));

    dt2.Columns.Add("Col 11", typeof(string));

    dt2.Columns.Add("Col 22", typeof(string));

    dt2.Columns.Add("Col 33", typeof(int));

    dt2.Columns.Add("Col 44", typeof(int));

     

    ds.Tables.Add(dt);

    ds.Tables.Add(dt2);

     

     

    DataRelation dr = new DataRelation("DR", dt.Columns["ID"], dt2.Columns["PID"], true);

    ds.Relations.Add(dr);

    ultraGrid1.DataSource = ds;

     

    Please take a look at the attached sample for more details and let me know if you have any questions.

    Regards ...

Reply Children