473,508 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom control renders table but doesn't resize at design time.

Hi all,

I have a control, that basically is my own version of the datagrid,
except that is renderers purely readonly tabular information.

When the control is rendered to the designer, I can click on the
control as rendered and move it, however I cannot resize it. I can
change the height and Width properties in the PropertyGrid and they
change, but the control doesn't resize.

When using the mouse to change the size, the control doesn't actually
resize, but the Width and Height properties do change. I can save the
changes, close the webform and open it again and it will display as I
had resized it. Here's a summary of what happens when I use the size
grips (the white boxes at each compass point that allow resizing with
the mouse). None of the these will change the size, some move the
control, some don't even affect the control - but all change the width
and height properties.

N: Moves the control up and down.
NW: Move the control in all directions.
W: Moves the control left and right
SW: Moves the control left and right.
S: No movement
SE: No movement
E: No movement
NE: Move the control up and down.

You can see for yourselves, below is the code for a simple control that
does the same:

Any ideas, it seems that the control is not resizing and re-rendering.
In WindowsForms you would capture the OnResize event and call
Me.Invalidate.

Thanks

Alex

#######Code Start########
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.WebControls

<ToolboxData("<{0}:ctlTestGrid runat=server></{0}:TestGrid>")> _
Public Class TestGrid

Inherits System.Web.UI.WebControls.WebControl

Protected Overrides Sub Render(ByVal output As
System.Web.UI.HtmlTextWriter)
EnsureChildControls()
Me.RenderChildren(output)
End Sub

Protected Overrides Sub CreateChildControls()

Dim objTable As New Web.UI.WebControls.Table
For intRow As Int32 = 1 To 5
objTable.Rows.Add(New TableRow)
For intColumn As Int32 = 1 To 5
objTable.Rows(intRow - 1).Cells.Add(New TableCell)
objTable.Rows(intRow - 1).Cells(intColumn - 1).Text =
"######"
Next
Next

objTable.Width = MyBase.Width
objTable.Height = MyBase.Height

Me.Controls.Add(objTable)

End Sub

End Class
#######Code End########

Nov 19 '05 #1
0 1555

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

Similar topics

0
1996
by: jb_in_marietta | last post by:
All, I have written a very simple custom composite control that includes a control of type System.Web.UI.WebControls.Table. The control renders fine in run time, but for some reason, it does...
19
2951
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and...
2
3886
by: Pham Nguyen | last post by:
Has anyone seen an example of a textbox server control that has built-in client-side validation? I'd like to build a server control that extends the System.Web.UI.WebControls.TextBox class to allow...
2
4284
by: KarlCharlotteNc | last post by:
I have a custom server control that renders a Submit button. The button renders just fine at design and run time. The button click event is being trapped normally. My problem : If I add a...
7
2972
by: Shimon Sim | last post by:
I have a custom composite control I have following property
0
1586
by: pabloazorin | last post by:
I developed a Date Picker web control using C# and .net framework 1.1 I added my control to Visual Studio 2003 IDE toolbar. When I drag and drop my control to design web page, the control renders...
15
6474
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
2
19404
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
2897
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
7225
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,...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3195
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1558
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.