Ask a Question related to ASP.NET General, Design and Development.
-
Rob #1
Problem finding datagrid in Page.controls collection
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.
collection. I am able>-----Original Message-----
>Hi,
>I am recursively finding the datagrid in page.controlsgrid using>to find everything but not datagrid.
>Has anyone experienced it before. I am able to find thetypeof operator>findControl but not within conrols collection using>For Each oControl In pCOntrol
>
>if Typeof oControl is DataGrid then
>
>....
>
>Thanks in advance
>
>Regards,
>
>
>
>.
>Rob Guest
-
A solution to finding controls in datagrid footer...
Hi all, I saw a lots of developers posting question on finding controls in datagrid footer... I have experimenting differents solution and find... -
Adding a control to the DataGrid collection controls
Hi I have built a DataGrid custom adding a panel of selection automatically produced in base to the columns of the DataGrid The panel has... -
Finding the row index in a collection of rows
So that I can find the pageindex in my datagrid, I need to know the index in a collection of rows where based on a record id. Right now, I have to... -
Finding the right page for a row in a datagrid.
I have an "Add Company" linkbutton on my page that allows a user to add a company. Once the company is added I can re-fill the data adapter and... -
Finding the non-matching values collection/array
Hi all, Ok, lets say I have the following, Request.Form collection which produces this (as the element names) a b c d -
MS #2
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...> 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.
>
>> collection. I am able> >-----Original Message-----
> >Hi,
> >I am recursively finding the datagrid in page.controls> grid using> >to find everything but not datagrid.
> >Has anyone experienced it before. I am able to find the> typeof operator> >findControl but not within conrols collection using> >For Each oControl In pCOntrol
> >
> >if Typeof oControl is DataGrid then
> >
> >....
> >
> >Thanks in advance
> >
> >Regards,
> >
> >
> >
> >.
> >
MS Guest
-
MS #3
Re: Problem finding datagrid in Page.controls collection
Ok I figure it out it is the ID of page in HTML.Another question is; Is
there any way I can findout this property without hardcoding it?
Thanks in advance
"MS" <MNadeemAkhter@lycos.com> wrote in message
news:%23aLqlgWTDHA.2180@TK2MSFTNGP10.phx.gbl...> Thanks Rob,
> But tell me what is "form1" here
>
> Regards,
>
> "Rob" <orkeytell@hotmail.com> wrote in message
> news:024001c34d58$2f662530$a301280a@phx.gbl...>> > 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.
> >
> >> > collection. I am able> > >-----Original Message-----
> > >Hi,
> > >I am recursively finding the datagrid in page.controls> > grid using> > >to find everything but not datagrid.
> > >Has anyone experienced it before. I am able to find the> > typeof operator> > >findControl but not within conrols collection using> > >For Each oControl In pCOntrol
> > >
> > >if Typeof oControl is DataGrid then
> > >
> > >....
> > >
> > >Thanks in advance
> > >
> > >Regards,
> > >
> > >
> > >
> > >.
> > >
>
MS Guest
-
Rob #4
Re: Problem finding datagrid in Page.controls collection
You need to specify the data grid within the form.
Form1 is the id of Form. I think this answers your
question.
the>-----Original Message-----
>Thanks Rob,
>But tell me what is "form1" here
>
>Regards,
>
>"Rob" <orkeytell@hotmail.com> wrote in message
>news:024001c34d58$2f662530$a301280a@phx.gbl...>> 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.
>>
>>>> collection. I am able>> >-----Original Message-----
>> >Hi,
>> >I am recursively finding the datagrid in page.controls>> >to find everything but not datagrid.
>> >Has anyone experienced it before. I am able to find>>> grid using>> typeof operator>> >findControl but not within conrols collection using>> >For Each oControl In pCOntrol
>> >
>> >if Typeof oControl is DataGrid then
>> >
>> >....
>> >
>> >Thanks in advance
>> >
>> >Regards,
>> >
>> >
>> >
>> >.
>> >
>
>.
>Rob Guest



Reply With Quote

