Dynamically placing controls/ page items at runtime

Discussion in 'ASP .Net Building Controls' started by The Crow, Oct 26, 2005.

  1. The Crow

    The Crow Guest

    placing runat="server" to the table and and something like ,
    table.Rows[4].Cells[3].Controls.Add(lnkButton); , will work.
    The Crow, Oct 26, 2005
    #1
    1. Advertising

  2. The Crow

    chris Guest

    "Grant" <> wrote in message
    news:%...
    >I have this table on my form which gets populated with data from my
    >database at runtime. I would like to place some controls (linkbutton,
    >textbox etc.) beneath the table when it is complete - at the moment the
    >controls just stay where I place them and the table gets built on top of
    >them. I have tried searching the net for a solution but being on dial up
    >its excruciatingly slow and I havent yet found the answer. Please could
    >someone point me in the right direction...
    >
    > I am using c# and asp.net
    >
    > Thanks,
    > Grant
    >
    chris, Oct 26, 2005
    #2
    1. Advertising

  3. The Crow

    Grant Guest

    I have this table on my form which gets populated with data from my database
    at runtime. I would like to place some controls (linkbutton, textbox etc.)
    beneath the table when it is complete - at the moment the controls just stay
    where I place them and the table gets built on top of them. I have tried
    searching the net for a solution but being on dial up its excruciatingly
    slow and I havent yet found the answer. Please could someone point me in the
    right direction...

    I am using c# and asp.net

    Thanks,
    Grant
    Grant, Oct 26, 2005
    #3
  4. The Crow

    Ollie Riches Guest

    All web controls inherit from System.Web.UI.Control which has a property
    called 'Controls' this is container of controls hosted by the current
    control so you can do the following if you had a Panel control on your aspx
    page:

    ....
    TextBox myTextBox = new TextBox();
    myPanel.Controls.Add(myTextBox);
    ....

    Or since you are displaying information from a database I guess you are
    using a DataGrid or Repeater control both of which support header and footer
    templates that allow you to add controls as you wish

    here is an article on adding controls to the footer of a datagrid

    http://www.extremeexperts.com/Net/Articles/AddingControlstoFooter.aspx

    datagrid girl is always a good resource as well:

    http://www.datagridgirl.com/default.aspx

    HTH

    Ollie Riches



    "Grant" <> wrote in message
    news:%...
    >I have this table on my form which gets populated with data from my
    >database at runtime. I would like to place some controls (linkbutton,
    >textbox etc.) beneath the table when it is complete - at the moment the
    >controls just stay where I place them and the table gets built on top of
    >them. I have tried searching the net for a solution but being on dial up
    >its excruciatingly slow and I havent yet found the answer. Please could
    >someone point me in the right direction...
    >
    > I am using c# and asp.net
    >
    > Thanks,
    > Grant
    >
    Ollie Riches, Oct 26, 2005
    #4
  5. The Crow

    J. Merrill Guest

    Did "chris" actually say nothing, or is it just not visible via the MS
    web-based newsreader?

    Thanks.
    --
    J. Merrill / Analytical Software Corp.


    "chris" wrote:

    >
    > "Grant" <> wrote in message
    > news:%...
    > >I have this table on my form which gets populated with data from my
    > >database at runtime. I would like to place some controls (linkbutton,
    > >textbox etc.) beneath the table when it is complete - at the moment the
    > >controls just stay where I place them and the table gets built on top of
    > >them. I have tried searching the net for a solution but being on dial up
    > >its excruciatingly slow and I havent yet found the answer. Please could
    > >someone point me in the right direction...
    > >
    > > I am using c# and asp.net
    > >
    > > Thanks,
    > > Grant
    > >

    >
    >
    >
    J. Merrill, Oct 26, 2005
    #5
  6. The Crow

    Ollie Riches Guest

    say nothing...

    "J. Merrill" <> wrote in message
    news:D...
    > Did "chris" actually say nothing, or is it just not visible via the MS
    > web-based newsreader?
    >
    > Thanks.
    > --
    > J. Merrill / Analytical Software Corp.
    >
    >
    > "chris" wrote:
    >
    >>
    >> "Grant" <> wrote in message
    >> news:%...
    >> >I have this table on my form which gets populated with data from my
    >> >database at runtime. I would like to place some controls (linkbutton,
    >> >textbox etc.) beneath the table when it is complete - at the moment the
    >> >controls just stay where I place them and the table gets built on top of
    >> >them. I have tried searching the net for a solution but being on dial up
    >> >its excruciatingly slow and I havent yet found the answer. Please could
    >> >someone point me in the right direction...
    >> >
    >> > I am using c# and asp.net
    >> >
    >> > Thanks,
    >> > Grant
    >> >

    >>
    >>
    >>
    Ollie Riches, Oct 26, 2005
    #6
  7. The Crow

    The Crow Guest

    ehhehegh. sometimes MVP's says also 'nothing'. i cant figure out how it
    happens.
    The Crow, Oct 26, 2005
    #7
  8. The Crow

    Grant Guest

    Thanks this worked for me :)

    "Ollie Riches" <> wrote in message
    news:On$...
    > All web controls inherit from System.Web.UI.Control which has a property
    > called 'Controls' this is container of controls hosted by the current
    > control so you can do the following if you had a Panel control on your
    > aspx page:
    >
    > ...
    > TextBox myTextBox = new TextBox();
    > myPanel.Controls.Add(myTextBox);
    > ...
    >
    > Or since you are displaying information from a database I guess you are
    > using a DataGrid or Repeater control both of which support header and
    > footer templates that allow you to add controls as you wish
    >
    > here is an article on adding controls to the footer of a datagrid
    >
    > http://www.extremeexperts.com/Net/Articles/AddingControlstoFooter.aspx
    >
    > datagrid girl is always a good resource as well:
    >
    > http://www.datagridgirl.com/default.aspx
    >
    > HTH
    >
    > Ollie Riches
    >
    >
    >
    > "Grant" <> wrote in message
    > news:%...
    >>I have this table on my form which gets populated with data from my
    >>database at runtime. I would like to place some controls (linkbutton,
    >>textbox etc.) beneath the table when it is complete - at the moment the
    >>controls just stay where I place them and the table gets built on top of
    >>them. I have tried searching the net for a solution but being on dial up
    >>its excruciatingly slow and I havent yet found the answer. Please could
    >>someone point me in the right direction...
    >>
    >> I am using c# and asp.net
    >>
    >> Thanks,
    >> Grant
    >>

    >
    >
    Grant, Oct 31, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe
    Replies:
    1
    Views:
    448
    Lowell Heddings
    Dec 8, 2004
  2. Stu
    Replies:
    4
    Views:
    478
  3. =?Utf-8?B?ZGhucml2ZXJzaWRl?=

    placing dynamic controls?

    =?Utf-8?B?ZGhucml2ZXJzaWRl?=, Feb 8, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    538
    =?Utf-8?B?ZGhucml2ZXJzaWRl?=
    Feb 8, 2005
  4. Replies:
    2
    Views:
    346
  5. fulio pen
    Replies:
    6
    Views:
    372
Loading...

Share This Page