Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
eagle #1
Declaring the name of a grid
How can I declare the name of a grid, then use it to bind it to the
datasource?
I have 3 grids, each with different id's. dgOne, dgTwo, dgThree. I want to
be able to do things to each grid. So I need to pass the name of the grid
to the GetData procedure. What I have done so far:
arrGridNames(1) = "One"
arrGridNames(2) = "Two"
arrGridNames(3) = "Three"
dg = "dg" & arrGridNames(1)
so that I come up with dgOne. But of course that is a string, and can't be
a datagrid, so when I try to bind it, I get the error: public member
'Datasource" on type 'String' not found.
How would I do this?
eagle Guest
-
Declaring methods
I'm an old school C++ programmer that switched to CF development years back. Now with AS3 I've decided to branch out and learn Flex3 and AS3. ... -
Declaring Web Services in AS
Hi, I know I can declare/initiate new WS using <mx:WebService> im my MXML code. I was wondering if it's possible to declare these services using... -
Declaring variables across frames
Hey guys, When I use the LoadVars object to submit a form, and I have different variables across four frames (four page form), how do I declare... -
Declaring a Variable
When I "test movie" a long Flash movie whose first three lines are //--- Number of Questions-- var my_totalquestions:Number = 20... -
Declaring sub at top or bottom matter?
Does declaring at the top or the bottom matter? thanks ----------------------------------------- eMail solutions by http://www.swanmail.com -
S.M. Altaf [MVP] #2
Re: Declaring the name of a grid
Use the FindControl Method.
Here is an example of what you could do, I'm typing this straight into the
email without an IDE, so you'll pardon any syntax errors. :)
Dim dgTemp As New DataGrid
dgTemp = CType(Page.FindControl("DataGrid1or2or3"), DataGrid)
dgTemp.DataSource = dt
dgTemp.DataBind();
HTH
-S.M. Altaf
[MVP - VB]
--------------------------------------------------------------------------------
All that glitters has a high refractive index. [url]www.mendhak.com[/url]
"eagle" <eagle@yahoo.com> wrote in message
news:uKJvhrvsFHA.3604@tk2msftngp13.phx.gbl...> How can I declare the name of a grid, then use it to bind it to the
> datasource?
>
> I have 3 grids, each with different id's. dgOne, dgTwo, dgThree. I want
> to be able to do things to each grid. So I need to pass the name of the
> grid to the GetData procedure. What I have done so far:
>
> arrGridNames(1) = "One"
> arrGridNames(2) = "Two"
> arrGridNames(3) = "Three"
>
> dg = "dg" & arrGridNames(1)
>
> so that I come up with dgOne. But of course that is a string, and can't
> be a datagrid, so when I try to bind it, I get the error: public member
> 'Datasource" on type 'String' not found.
>
> How would I do this?
>
>
>
>
S.M. Altaf [MVP] Guest



Reply With Quote

