Positioning Controls in an AccordionPane in the Code Behind

Last post 10-25-2006 5:05 PM by Ted Glaza [MSFT]. 1 replies.

Sort Posts:

  • Positioning Controls in an AccordionPane in the Code Behind

    10-12-2006, 9:31 AM
    • Loading...
    • Bizzy
    • Joined on 10-06-2006, 4:30 PM
    • Posts 6

    I am trying to format the layout of my controls inside an Accoridon Pane, but I don't know how to put them in the correct position.  Using absolute position I can put the control any where on the page but it is always visible and I want it to collapse with Accoridon.  Also the Autosize of the pane no longer works because it is as if the control is not part  of the Accordion pane.  Does anyone know how to set the position of a control from the code behind, inside  an Accordion Pane?  Please help.

    Here is my code where I am creating the controls and setting the position 

            GridView gvAdd = NewGridView(4);
            gvAdd.ID = "gvAdd";
            gvAdd.DataSource = data.Tables[3];
            gvAdd.DataBind();
            gvAdd.Style.Add("z-index", "1");  //Here is where I am trying to set the control position
            gvAdd.Style.Add("left", "408px");
            gvAdd.Style.Add("position", "absolute");
            gvAdd.Style.Add("top", "200px");
            gvAdd.SelectedIndexChanged += new EventHandler(gvAdd_SelectedIndexChanged);
            gvAdd.Width = 350;
            AccordionCampaign.ContentContainer.Controls.Add(gvAdd);
     
  • Re: Positioning Controls in an AccordionPane in the Code Behind

    10-25-2006, 5:05 PM
    Hi Bizzy,

    Absolute positioning inside an AccordionPane doesn't really make a lot of sense because the panes are meant to act like containers.  I'd recommend you take a look at other basic CSS techniques.

    Thanks,
    Ted
    This posting is provided "AS IS" with no warranties, and confers no rights.
Page 1 of 1 (2 items)
Microsoft Communities
Page view counter