| re: Problem finding datagrid in Page.controls collection
Thanks Rob,
But tell me what is "form1" here
Regards,
"Rob" <orkeytell@hotmail.com> wrote in message
news:024001c34d58$2f662530$a301280a@phx.gbl...[color=blue]
> You can find datagrid in page by refering the form.
> Gatagrid is a child control of Form.
>
> Here is the code
> -----------------
>
> Dim ctl As New Control
> For Each ctl In Page.FindControl("form1").Controls
> If TypeOf ctl Is DataGrid Then
> Response.Write(ctl.ID)
> End If
>
> Next
>
>
> Let me know if it works.
>
>[color=green]
> >-----Original Message-----
> >Hi,
> >I am recursively finding the datagrid in page.controls[/color]
> collection. I am able[color=green]
> >to find everything but not datagrid.
> >Has anyone experienced it before. I am able to find the[/color]
> grid using[color=green]
> >findControl but not within conrols collection using[/color]
> typeof operator[color=green]
> >For Each oControl In pCOntrol
> >
> >if Typeof oControl is DataGrid then
> >
> >....
> >
> >Thanks in advance
> >
> >Regards,
> >
> >
> >
> >.
> >[/color][/color] |