Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Casting user Control in Grid

Reply
Thread Tools

Casting user Control in Grid

 
 
Shimon Sim
Guest
Posts: n/a
 
      08-30-2005
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.


 
Reply With Quote
 
 
 
 
Shimon Sim
Guest
Posts: n/a
 
      08-30-2005
OK. I found easy solution. FindControl() works just fine.
Thanks.
Shimon.
"Shimon Sim" <> wrote in message
news:...
> 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.
>
>



 
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
User Control to Control Other User Control Jonathan Wood ASP .Net 4 02-02-2010 03:41 PM
Up casting and down casting Sosuke C++ 2 12-20-2009 03:24 PM
Problem with depracated casting method (down casting) Wally Barnes C++ 3 11-20-2008 05:33 AM
persisting changes to a control outside a user control from the user control? Mad Scientist Jr ASP .Net 0 03-22-2006 08:02 AM
Another question about inheritance (up-casting and down-casting) kevin Java 11 01-08-2005 07:11 PM



Advertisments