473,388 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

C# ASP.NET Tables

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(DBManager.Entities[] ent,
DBManager.Attributes[] att)
{
// create a DataSet with one table, two columns
DataSet myDS = new DataSet();

// create Entity table
DataTable t = new DataTable("definitive");
myDS.Tables.Add(t);
t.Columns.Add("obj");

DataSet ds = CreateDataSource(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]["Description"] } );
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!
Nov 16 '05 #1
0 1586

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

44
by: Mariusz Jedrzejewski | last post by:
Hi, I'll be very grateful if somebody can explain me why my Opera 7.23 (runing under linux) doesn't show me inner tables. Using below code I can see only "inner table 1". There is no problem with...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
59
by: phil-news-nospam | last post by:
In followups by Brian O'Connor (ironcorona) to other posts, he repeats the idea that using tables in CSS is not something that should be done because IE doesn't support it. Of course I'm not happy...
5
by: rdemyan via AccessMonster.com | last post by:
I have a need to add another field to all of my tables (over 150). Not data, but an actual field. Can I code this somehow. So the code presumabley would loop through all the tables, open each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.