Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > datagrid in datagrid

Reply
Thread Tools

datagrid in datagrid

 
 
BK Kim
Guest
Posts: n/a
 
      02-23-2004
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



 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      03-02-2004
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"BK Kim" <> wrote in message
news:eVcb%23Zm%...
> 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
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Added CheckBox to a DataGrid Doesn't work with DataGrid.Enabled=False Amar ASP .Net 0 04-06-2004 10:14 AM
Re: Datagrid: how cut short display of a long description in a datagrid column Brian K. Williams ASP .Net 0 03-02-2004 08:35 PM
RE: Datagrid: how cut short display of a long description in a datagrid column =?Utf-8?B?U3VyZXNo?= ASP .Net 0 03-02-2004 08:31 PM
Call Datagrid Command column outside datagrid Dave ASP .Net 0 11-20-2003 11:11 AM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57