472,791 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

datagrid in datagrid

Hello.

I am trying to use dataGrid in a dataGrid, meaning first DataGrid displays
some information and on each row, it is going to have another datagrid to
display detailed information.

I was able to do it in two dataGrid. ( one datagrid containing a datagrid in
each row )

But I was not able to do it in three dataGrid.

Generally, I bind the first DataGrid and on ItemCreated event, I add a cell
into that row containing dataGrid. ( works fine )

private void grdTemp_ItemCreated(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)

{

if( e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem )

{

System.Web.UI.WebControls.DataGrid grdTemp2 = new DataGrid();

grdTemp2.ItemCreated += new
System.Web.UI.WebControls.DataGridItemEventHandler (this.grdTemp2_ItemCreated
);

e.Item.Cells[0].Controls.Add(grdTemp2);
grdTemp2.DataSource = getData(2);

grdTemp2.DataBind();

}
}

private void grdTemp2_ItemCreated(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)

{

if( e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem )

{

System.Web.UI.WebControls.DataGrid grdTemp3 = new DataGrid();
grdTemp3.DataSource = getData(3);

grdTemp3.DataBind();

e.Item.Cells[0].Controls.Add(grdTemp3);
}

}
Does anyone knows, how to do this or why this code doesn't work?
Thanx in advance

Nov 18 '05 #1
0 1289

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

Similar topics

8
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
5
by: BBFrost | last post by:
Win2000 ..Net 1.1 SP1 c# using Visual Studio Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1 datagrid. I've come to realize that a 'block' of rows highlighted within...
2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
3
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
2
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
7
by: Dave | last post by:
Are there any add-on products or samples available that can do the following in an vb.net datagrid I want to compare 2 rows in a datagrid - one row from one database and another row for another...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.