[CLOSED] Restricion in nesting Ext.Net.Controls?

Page 3 of 5 FirstFirst 12345 LastLast
  1. #21
    Quote Originally Posted by Daniil View Post
    There are no layout controls in Ext.NET v2 anymore, the changelog item #34:
    https://examples2.ext.net/#/Getting_...nts/CHANGELOG/



    I would just update to v1.5.
    http://ext.net/download

    Anyways, v1.3 sources you can find here:
    https://github.com/extnet/Ext.NET.Community/tree/1.3.0
    I took the advice and updated to v1.5 and now its seems to working but my example doesn't display button from SpecialControlContainer.ascx file.
  2. #22
    If combine the markup and code behind the result will look like this:

    Example
    <ext:Container runat="server" >
        <Items>
            <ext:Button runat="server" />
        </Items>
    </ext:Container>
    
    <ext:BorderLayout runat="server">
        <North>
            <ext:Panel runat="server" />
        </North>
        <Center>
            <ext:Panel runat="server" />
        </Center>
    </ext:BorderLayout>
    That is wrong. A layout control must be a single top level control within a user control.
  3. #23
    I doesn't know that :(

    So what's your propose to handle this? I can't change my someControlBorderLayout.ascx and I need to put on control SpecialControlContainer.ascx some extra buttons.
  4. #24
    I can't change my someControlBorderLayout.ascx
    Do you mean that you can't change the markup? Could you clarify why?

    Anyways, you can add buttons just to the Container.
  5. #25
    Yeah I can't change markup (if there are possibility to virtualize BorderLayout display behaviour in way to make display elements all the time in same place(now it's done with North Center South tags)?).

    in South region I got TabPanel with tabs which at the begin of page Should be Collapsed When there is no South region this TabPanel even when collapsed showing Tab in it which is incorrect.

    What do you mean to add buttons to container in previous post of yours you said I can't make such a thing
    That is wrong. A layout control must be a single top level control within a user control.
    ?

    Now I'm really confused. Can you please explain what do you mean?:)
  6. #26
    Quote Originally Posted by ViDom View Post
    What do you mean to add buttons to container in previous post of yours you said I can't make such a thing ?
    I mean the following.

    Example User Control
    <%@ Control Language="C#" %>
     
    <script runat="server">
        protected void Page_Init(object sender, EventArgs e)
        {
            this.Container1.Items.Add(new Ext.Net.Button()
                {
                    Text = "Added from the code behind"
                });
        }
    </script>
     
    <ext:Container ID="Container1" runat="server" >
        <Items>
            <ext:Button runat="server" Text="Defined in the markup" />
        </Items>
    </ext:Container>
    Please clarify why can't you create the Container (which is defined in the markup) in the code behind as well as additional Buttons, BorderLayout, etc.?
  7. #27
    Quote Originally Posted by Daniil View Post
    I mean the following.

    Example User Control
    <%@ Control Language="C#" %>
     
    <script runat="server">
        protected void Page_Init(object sender, EventArgs e)
        {
            this.Container1.Items.Add(new Ext.Net.Button()
                {
                    Text = "Added from the code behind"
                });
        }
    </script>
     
    <ext:Container ID="Container1" runat="server" >
        <Items>
            <ext:Button runat="server" Text="Defined in the markup" />
        </Items>
    </ext:Container>
    Please clarify why can't you create the Container (which is defined in the markup) in the code behind as well as additional Buttons, BorderLayout, etc.?
    It's not a problem to create Container. But how this will help? I tryed to create Container and then add to him my userControl with BorderLayout in it but it's result is a blank page without any controls at all. When I deleted borderLayout from my control it's display fine with 1 disturb detail.

    TabPanel with Tabs should be at bottom on the page but now it isn't

    screen of problem
    Click image for larger version. 

Name:	sampleError.png 
Views:	73 
Size:	61.1 KB 
ID:	4509

    Is there any way to make it happend without borderLayout and south region in it?
  8. #28
    Using BorderLayout for your layout looks a good option.

    You should place the Container into the BorderLayout as well.

    If you would clarify with a mockup how the things should exactly look I could suggest a possible layout.
  9. #29
    Quote Originally Posted by Daniil View Post
    Using BorderLayout for your layout looks a good option.

    You should place the Container into the BorderLayout as well.

    If you would clarify with a mockup how the things should exactly look I could suggest a possible layout.
    Here you go :

    Click image for larger version. 

Name:	mockup.png 
Views:	98 
Size:	14.4 KB 
ID:	4510

    the second control should be Load from code behind to the first one on OnInit method.
  10. #30
    Good, thanks.

    Here how I would implement that mockup.

    Example Master Page
    <%@  Master Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Viewport runat="server" Layout="BorderLayout">
                <Items>
                    <ext:Panel 
                        runat="server" 
                        Region="North" 
                        Title="Master North" 
                        Height="200" />
                    <ext:Panel runat="server" Region="Center" Title="Master Center">
                        <Content>
                            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" />
                        </Content>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
    Example User Control 1 (TestUC.ascx)
    <%@ Control Language="C#"%>
      
    <%@ Register TagPrefix="ext" Namespace="Ext.Net" %>
    
    <script runat="server">
        protected void Page_Init(object sender, EventArgs e)
        {
            this.Panel1.Items.Add(new Ext.Net.Button()
                {
                    Text = "Added from the code behind"
                });
    
            Control uc = this.LoadControl("TestUC2.ascx");
            this.Panel2.ContentControls.Add(uc);
        }
    </script>
     
    <ext:VBoxLayout runat="server" Align="Stretch">
        <BoxItems>
            <ext:BoxItem>
                <ext:Panel 
                    ID="Panel1" 
                    runat="server" 
                    Title="Buttons" 
                    Height="100">
                    <Items>
                        <ext:Button runat="server" Text="Defined in the markup" />
                    </Items>
                </ext:Panel>
            </ext:BoxItem>
            <ext:BoxItem Flex="1">
                <ext:Panel ID="Panel2" runat="server" Title="Content" />
            </ext:BoxItem>
        </BoxItems>
    </ext:VBoxLayout>
    Example User Control 2 (TestUC2.ascx)
    <%@ Control Language="C#"%>
      
    <%@ Register TagPrefix="ext" Namespace="Ext.Net" %>
     
    <ext:BorderLayout runat="server">
        <North>
            <ext:Panel runat="server" Title="Nested North" Height="100" />
        </North>
        <Center>
            <ext:Panel runat="server" Title="Nested Center" />
        </Center>
        <South Collapsible="true">
            <ext:TabPanel runat="server" Height="100">
                <Items>
                    <ext:Panel runat="server" Title="Tab 1" />
                    <ext:Panel runat="server" Title="Tab 2" />
                </Items>
            </ext:TabPanel>
        </South>
    </ext:BorderLayout>
    Example Content Page
    <%@ Page Language="C#" MasterPageFile="Master.Master" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <%@ Register Src="~/TestUC.ascx" TagPrefix="uc" TagName="TestUC" %>
     
    <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <uc:TestUC runat="server" />
    </asp:Content>
Page 3 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. Replies: 1
    Last Post: Jul 20, 2012, 8:08 AM
  2. [CLOSED] How should I nested ext.net.controls with user controls?
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 04, 2012, 11:14 AM
  3. Replies: 5
    Last Post: Nov 03, 2011, 2:39 AM
  4. Replies: 2
    Last Post: Feb 16, 2011, 9:10 AM
  5. Replies: 0
    Last Post: Jan 05, 2011, 6:48 AM

Tags for this Thread

Posting Permissions