Exemplo n.º 1
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            DataSet dataSet1 = new DataSet();

            dataSet1.Tables.Add(DataHelper.CreateTable());
            dataSet1.Tables.Add(DataHelper.CreateChildTable());
            dataSet1.Tables.Add(DataHelper.CreateEmptyTable());
            DataColumn keyColumn        = dataSet1.Tables[0].Columns["CustomerID"];
            DataColumn foreignKeyColumn = dataSet1.Tables[1].Columns["CustomerID"];

            dataSet1.Relations.Add("CustomersOrders", keyColumn, foreignKeyColumn);
            foreignKeyColumn = dataSet1.Tables[2].Columns["AnyColumn"];
            dataSet1.Relations.Add("Customers_AnyDataTable", keyColumn, foreignKeyColumn);
            myGridControl1.DataSource = dataSet1.Tables[0];
        }