Buttons Align on Panel

  1. #1

    Buttons Align on Panel

    Wonder if there is any way to put button 1 on top of Button 2

    Click image for larger version. 

Name:	Capture.PNG 
Views:	9 
Size:	14.3 KB 
ID:	7585

    <@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    
    
    <!DOCTYPE html>
    
    <html>
    <head id="Head1" runat="server">
        <title>Basic Row Command - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />    
    
      
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager runat="server" />
     
           <ext:Panel ID="Panel1" runat="server" Width="800" Header="true" Title="Test">
              <Buttons>
                 <ext:Button ID="Button1" runat="server" Text="Button 1" Width="80" />
                 <ext:Button ID="Button2" runat="server" Text="Button 2" Width="80" />
              </Buttons>
           </ext:Panel>
    
        </form>
    </body>
    </html>
  2. #2
    Hi @Yuniel

    I think you can use the layout as HBox ,
    as following
    <ext:Panel ID="panel1" runat="server" Layout="HBoxLayout" >
                  <items>
                              <ext:button runat="server" ID="btn1" Text="button1" />
                              <ext:button runat="server" ID="btn2" Text="button2"/>
                   </items>
    </ext:panel>
    Last edited by geoffrey.mcgill; Feb 12, 2014 at 9:04 PM. Reason: Please use [CODE] tags
  3. #3

    Thanks

    HBoxLayout will basically set it up same way i have it rigth now, used VBoxLayout but didnt change anything, if i get rid of the <Buttons> i can put them how i wanted but then i lose aligments. Example:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    
    
    <!DOCTYPE html>
    
    <html>
    <head id="Head1" runat="server">
        <title>Basic Row Command - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />    
    
      
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager runat="server" />
     
           <ext:Panel ID="Panel1" runat="server" Width="800" Header="true" Title="Test" Layout="VBoxLayout" ButtonAlign="Right">
              <Items>
                 <ext:Button ID="Button1" runat="server" Text="Button 1" Width="80" />
                 <ext:Button ID="Button2" runat="server" Text="Button 2" Width="80" />
              </Items>
           </ext:Panel>
    
        </form>
    </body>
    </html>
    Thanks for Reply tho.
  4. #4
    Hi everybody,

    There is no way to achieve it with Buttons. I can suggest the following solution.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Panel runat="server" Title="Panel" Html="Content">
                <DockedItems>
                    <ext:Container runat="server" Dock="Bottom">
                        <LayoutConfig>
                            <ext:HBoxLayoutConfig Pack="End" />
                        </LayoutConfig>
                        <Items>
                            <ext:Container runat="server" Layout="VBoxLayout">
                                <Items>
                                    <ext:Button runat="server" Text="Button 1" />
                                    <ext:Button runat="server" Text="Button 2" />
                                </Items>
                            </ext:Container>
                        </Items>
                    </ext:Container>
                </DockedItems>
            </ext:Panel>
        </form>
    </body>
    </html>

Similar Threads

  1. [CLOSED] Align formpanel buttons far left / far right
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 12, 2013, 11:22 AM
  2. [CLOSED] How to center align the buttons
    By Fahd in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 21, 2013, 8:31 PM
  3. how to left align the grid buttons
    By harshad.jadhav in forum 1.x Help
    Replies: 2
    Last Post: Nov 30, 2010, 8:00 AM
  4. Align Radio buttons horizantally
    By ajaybabu.maddinani in forum 1.x Help
    Replies: 2
    Last Post: Feb 23, 2010, 8:52 AM
  5. [CLOSED] Toolbar Align Buttons
    By CMA in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 18, 2009, 5:25 AM

Tags for this Thread

Posting Permissions