Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Casting user Control in Grid (http://www.velocityreviews.com/forums/t108943-casting-user-control-in-grid.html)

Shimon Sim 08-30-2005 02:12 PM

Casting user Control in Grid
 
Hi
I create user control to EditTemplate in DataGrid control
I need to cast to get correct type of the control like this

MyBox box=(MyBox) e.Item.Cells[0].Controls[0];
Usually if I need to add
protected MyBox idofcontrol;
Where I need to know exact id of the control. The is impossible with
DataGrid.
Any ideas how this can be done?
Thank you.
Shimon.



Shimon Sim 08-30-2005 03:17 PM

Re: Casting user Control in Grid
 
OK. I found easy solution. FindControl() works just fine.
Thanks.
Shimon.
"Shimon Sim" <shimonsim048@community.nospam> wrote in message
news:ern3gzWrFHA.2596@TK2MSFTNGP09.phx.gbl...
> Hi
> I create user control to EditTemplate in DataGrid control
> I need to cast to get correct type of the control like this
>
> MyBox box=(MyBox) e.Item.Cells[0].Controls[0];
> Usually if I need to add
> protected MyBox idofcontrol;
> Where I need to know exact id of the control. The is impossible with
> DataGrid.
> Any ideas how this can be done?
> Thank you.
> Shimon.
>
>





All times are GMT. The time now is 08:30 PM.

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