PDA

View Full Version : [CLOSED] My own control with flex size



supera
Feb 01, 2012, 7:43 PM
Hi!

It's wonderful how the controls ext.net fit the browser size.

I'm creating my own control to speed up some repetitive tasks.

I wish my own control also to fit in your control container. The container is a Ext.Panel and I declare my controle between <content> and </ content> tags.

Is there any way to my control inherit this feature?

Thanks for any help!

geoffrey.mcgill
Feb 01, 2012, 8:09 PM
Hi,

If your Control inherits from Ext.Net.Panel, then you can just add your Control into the <Items> Collection. And if inherited from Ext.Net.Panel, you will have inherited the .Flex property.

Hope this helps.

supera
Feb 02, 2012, 11:10 AM
Hi Geoffrey

Thanks for your answer...

I try follow your hint, but I fail.

The vb.net accepts only one inheritance by class.
If my control does not inherit by System.Web.UI.UserControl, I can not register my control in a aspx page.
The method to register my control in aspx page follow



<%@ Register src="~/app/tools/WebExplorer.ascx" tagname="WebExplorer" tagprefix="superaWebControl" %>


How can I consume my control in a aspx page inheriting from ext.net.Panel? is there another way?

Thanks for your help!!!

Daniil
Feb 02, 2012, 11:56 AM
Hi,

Really, there is no way to inherit a control from two classes.

There are the following two features in Ext.NET v2.

To understand the first one, please read the steps:

1. Define only Ext.NET controls at the top level of a user control.

2. Place that user control into Content of some Ext.NET container.

3. Set up a respective Layout for that container.

4. The feature - the top level Ext.NET controls of the user control become common items of the Ext.NET container and participate in the layout logic according to the Layout you set up for the container.

The second feature is the <ext:UserControlLoader> control. Set up a respective Path to a user control and use it within Items of any Ext.NET container. You will get the same effect that the first feature gives.


As well you can consider a possibility to inherit your control from the Ext.Net.Panel to use it directly within Items.

supera
Feb 02, 2012, 1:45 PM
Hi Daniil...

I follow your suggestions, and works very well...

1 - In my user control, I use only ext.net controls
2 - Load my usercontrol with ext:UserControlLoader



<ext:Panel ID="panelCenter" runat="server" Region="Center" BodyPadding="6" flex="1" Layout="FitLayout">
<Items>
<ext:UserControlLoader runat="server" Path="~/app/tools/WebExplorer.ascx" Flex="1">
</ext:UserControlLoader>
</Items>
</ext:Panel>


Now, that I can access the properties and methods of my usercontrol in codebehind, how should I proceed?
I must declare an id to the ext: UserControlLoader and always use it?

Daniil
Feb 02, 2012, 2:17 PM
Please use the UserControls collection of UserControlLoader.

Also there is the Components collection. It collects top level Ext.NET controls of a user control.

supera
Feb 02, 2012, 3:20 PM
Ok... thanks a lot, Daniil