Hi. i have this code and i would like to know how to populate a DataGrid
in order to display each 3 rows the following information:
row 1: Name1
row 2: Description1
row 3: Another DataGrid with Name1 details
row 4: Name2
row 5: Description2
row 6: Another DataGrid with Name2 details
..
..
..
Any help would be appreciated
DPE
public DataSet createData(DBMa nager.Entities[] ent,
DBManager.Attri butes[] att)
{
// create a DataSet with one table, two columns
DataSet myDS = new DataSet();
// create Entity table
DataTable t = new DataTable("defi nitive");
myDS.Tables.Add (t);
t.Columns.Add(" obj");
DataSet ds = CreateDataSourc e(ent, att);
for (int i = 0; i < ds.Tables["Entity"].Rows.Count; i++)
{
for (int j = 0; j <= 2; j++)
{
if (j == 0)
myDS.Tables[ "definitive " ].Rows.Add(new object[] {
ds.Tables["Entity"].Rows[i]["Name"] } );
else if (j == 1)
myDS.Tables[ "definitive " ].Rows.Add(new object[] {
ds.Tables["Entity"].Rows[i]["Descriptio n"] } );
else
{
DataTable dt = getAtt((int)ds. Tables["Entity"].Rows[i]["OID"]);
DataGrid dg = new DataGrid();
dg.DataSource = dt;
dg.Visible = true;
myDS.Tables[ "definitive " ].Rows.Add(new object[] { dg } );
}
}
}
return myDS;
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!