Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   datagrid in datagrid (http://www.velocityreviews.com/forums/t73812-datagrid-in-datagrid.html)

BK Kim 02-23-2004 11:41 PM

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




Alvin Bruney [MVP] 03-02-2004 06:34 AM

Re: datagrid in datagrid
 
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" <bkkim@destinationrx.com> wrote in message
news:eVcb%23Zm%23DHA.3384@TK2MSFTNGP11.phx.gbl...
> 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
>
>
>





All times are GMT. The time now is 11:51 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.