[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

Using FindControl to search for control inside of ObjectList's ItemTemplate

slava_th

2/18/2005 2:07:00 AM

Hello,

I have a DataBind event handler and want to find some control by
it's ID in a current row ObjectListItem (...EventArgs.ListItem).
I do as curtain MSDN - use ObjectListItem.FindControl("id") but method
returns me null. I used to use this FindControl technique
in Web forms but seems like it doesn't work in mobile forms ?

Also I've discovered that ObjectListItem.Controls.Count = 0 too,
so of course it doesn't find anything, but how to do it ???

Thanks,

Slava

3 Answers

R. Thomas, aka Xtreme.Net

2/21/2005 3:29:00 AM

0

If the count is 0, that means there is nothing inside... can u make sure that
the count is not 0 before searchin? did u add the controls to where u think
you did?
R. Thomas

"Vlad" wrote:

> Hello,
>
> I have a DataBind event handler and want to find some control by
> it''s ID in a current row ObjectListItem (...EventArgs.ListItem).
> I do as curtain MSDN - use ObjectListItem.FindControl("id") but method
> returns me null. I used to use this FindControl technique
> in Web forms but seems like it doesn''t work in mobile forms ?
>
> Also I''ve discovered that ObjectListItem.Controls.Count = 0 too,
> so of course it doesn''t find anything, but how to do it ???
>
> Thanks,
>
> Slava
>
>

slava_th

2/21/2005 9:55:00 AM

0

Hi Thomas,

I do databinding in LoadList event handler.
lstContacts.DataSource = tPage;
lstContacts.DataBind();

Ok, thanks, I''ll check all again, maybe DataBind event is raised before
controls are added.

Slava

R. Thomas, aka Xtreme.Net wrote:
> If the count is 0, that means there is nothing inside... can u make
sure that
> the count is not 0 before searchin? did u add the controls to where u
think
> you did?
> R. Thomas
>
> "Vlad" wrote:
>
> > Hello,
> >
> > I have a DataBind event handler and want to find some control by
> > it''s ID in a current row ObjectListItem (...EventArgs.ListItem).
> > I do as curtain MSDN - use ObjectListItem.FindControl("id") but
method
> > returns me null. I used to use this FindControl technique
> > in Web forms but seems like it doesn''t work in mobile forms ?
> >
> > Also I''ve discovered that ObjectListItem.Controls.Count = 0 too,
> > so of course it doesn''t find anything, but how to do it ???
> >
> > Thanks,
> >
> > Slava
> >
> >

R. Thomas, aka Xtreme.Net

2/22/2005 1:05:00 AM

0

Sure, do post back here if you have more probs...
R. Thomas


"Vlad" wrote:

> Hi Thomas,
>
> I do databinding in LoadList event handler.
> lstContacts.DataSource = tPage;
> lstContacts.DataBind();
>
> Ok, thanks, I''ll check all again, maybe DataBind event is raised before
> controls are added.
>
> Slava
>
> R. Thomas, aka Xtreme.Net wrote:
> > If the count is 0, that means there is nothing inside... can u make
> sure that
> > the count is not 0 before searchin? did u add the controls to where u
> think
> > you did?
> > R. Thomas
> >
> > "Vlad" wrote:
> >
> > > Hello,
> > >
> > > I have a DataBind event handler and want to find some control by
> > > it''s ID in a current row ObjectListItem (...EventArgs.ListItem).
> > > I do as curtain MSDN - use ObjectListItem.FindControl("id") but
> method
> > > returns me null. I used to use this FindControl technique
> > > in Web forms but seems like it doesn''t work in mobile forms ?
> > >
> > > Also I''ve discovered that ObjectListItem.Controls.Count = 0 too,
> > > so of course it doesn''t find anything, but how to do it ???
> > >
> > > Thanks,
> > >
> > > Slava
> > >
> > >
>
>