473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Composite Control - Control sizing

I have created a fairly basic composite control consisting of a Label
and a TextBox. In the overridden Render function, I'm creating a
table with two rows and each row contains a cell (td). The Label and
the TextBox are each rendered in one of the cells. Everything renders
fine. The problem is that depending on the column the control
represents I may want the textbox to be a different visible size
during both design and runtime. I exposed a public property of the
control to allow setting of the TextBox.Columns property but it does
not seem to have any effect.

Help would be appreciated.
Sep 11 '07 #1
3 1932
The Columns property of a TextBox sets the "size" HTML attribute of the
TextBox. This may be overridden by CSS styles. Other than that, I don't know
what you mean by "does not seem to have any effect."

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Eric" <as**@a.comwrote in message
news:uy*************@TK2MSFTNGP06.phx.gbl...
>I have created a fairly basic composite control consisting of a Label
and a TextBox. In the overridden Render function, I'm creating a
table with two rows and each row contains a cell (td). The Label and
the TextBox are each rendered in one of the cells. Everything renders
fine. The problem is that depending on the column the control
represents I may want the textbox to be a different visible size
during both design and runtime. I exposed a public property of the
control to allow setting of the TextBox.Columns property but it does
not seem to have any effect.

Help would be appreciated.

Sep 12 '07 #2
Kevin,
Thanks for the reply. I guess what I'm looking for is the ability to
anchor the Label control and TextBox control to the composite control
container. If I resize the composite control, I would like the two
contained controls to re-size with it (at least the width). What I meant by
setting the Columns property of the TextBox has no effect is that changing
the value of the Columns property of the Textbox contained in the composite
control does not change its length.

<form id="form1" runat="server">
<div>
<asp:TextBox Columns="50" runat="server" ID="TB1"></asp:TextBox>
//expands the visible width of the TextBox
<abc:MyComposite TextBoxLength="50" runat="server"
ID="TB2"></abc:MyComposite>//In my composite control TextBoxLength changes
the Column value of the TextBox but it does not work
</div>
</form>
"Kevin Spencer" <un**********@nothinks.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
The Columns property of a TextBox sets the "size" HTML attribute of the
TextBox. This may be overridden by CSS styles. Other than that, I don't
know what you mean by "does not seem to have any effect."

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Eric" <as**@a.comwrote in message
news:uy*************@TK2MSFTNGP06.phx.gbl...
>>I have created a fairly basic composite control consisting of a Label
and a TextBox. In the overridden Render function, I'm creating a
table with two rows and each row contains a cell (td). The Label and
the TextBox are each rendered in one of the cells. Everything renders
fine. The problem is that depending on the column the control
represents I may want the textbox to be a different visible size
during both design and runtime. I exposed a public property of the
control to allow setting of the TextBox.Columns property but it does
not seem to have any effect.

Help would be appreciated.


Sep 12 '07 #3
The "size" attribute of an HTML text box(input type="text') is an HTML
attribute that sets the size (width) of the text box in characters. Can you
post the actual HTML generated for the composite control? That would yield
more information.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"eric" <7ak@!_df.comwrote in message
news:uZ**************@TK2MSFTNGP05.phx.gbl...
Kevin,
Thanks for the reply. I guess what I'm looking for is the ability to
anchor the Label control and TextBox control to the composite control
container. If I resize the composite control, I would like the two
contained controls to re-size with it (at least the width). What I meant
by setting the Columns property of the TextBox has no effect is that
changing the value of the Columns property of the Textbox contained in the
composite control does not change its length.

<form id="form1" runat="server">
<div>
<asp:TextBox Columns="50" runat="server" ID="TB1"></asp:TextBox>
//expands the visible width of the TextBox
<abc:MyComposite TextBoxLength="50" runat="server"
ID="TB2"></abc:MyComposite>//In my composite control TextBoxLength changes
the Column value of the TextBox but it does not work
</div>
</form>
"Kevin Spencer" <un**********@nothinks.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>The Columns property of a TextBox sets the "size" HTML attribute of the
TextBox. This may be overridden by CSS styles. Other than that, I don't
know what you mean by "does not seem to have any effect."

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Eric" <as**@a.comwrote in message
news:uy*************@TK2MSFTNGP06.phx.gbl...
>>>I have created a fairly basic composite control consisting of a Label
and a TextBox. In the overridden Render function, I'm creating a
table with two rows and each row contains a cell (td). The Label and
the TextBox are each rendered in one of the cells. Everything renders
fine. The problem is that depending on the column the control
represents I may want the textbox to be a different visible size
during both design and runtime. I exposed a public property of the
control to allow setting of the TextBox.Columns property but it does
not seem to have any effect.

Help would be appreciated.



Sep 13 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Satya Bojanapally | last post by:
Hi, I am unable to add a pager for this composite control. I had created a composite control in C#. The control is having 5 labels, one radio button and one DropDownList control. The composite...
1
by: Paul Kia | last post by:
I have an ATL composite control which I drop into a tab control dialog page of an MFC application. When I click on the composite control and then click anywhere outside the MFC application, the...
5
by: KJ | last post by:
This is kind of hard to explain but I have a The controls are created with CreateChildControls(). Now let say I click a button and an error occurs in the control. If I throw it up it goes back...
1
by: sleigh | last post by:
Hello, I'm building a web application that will build a dynamic form based upon questions in a database. This form will have several different sections that consist of a panel containing one to...
10
by: dx | last post by:
I have the Microsoft Press: Developing Microsoft ASP.NET Server Controls and Components book. It's starting to shine some light on control development but there is something about composite...
1
by: Jeff | last post by:
Hi - I am developing a composite control using VB.NET. In the ASP.NET page using the control, How can I update a label text value to reflect the value of a property of the custom control...
0
by: multiformity | last post by:
Ok, so I have gone off and documented the lifecycle of a page with a custom composite control on it. You can find that document here: http://www.ats-engineers.com/lifecycle.htm Now, I am...
3
by: Beavis | last post by:
I hate to repost a message, but I am still at the same point where I was when I originally posted, and hopefully someone else will see this one... Ok, so I have gone off and documented the...
6
by: shapper | last post by:
Hello, I am working in a class library with various custom controls. In which cases should a control inherit Control, WebControl and CompositeControl classes? And when should a custom...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.