develop a Web Custom Control

M

Mahesh

I tried to develop a Web Custom Control and it is shown
below.

Imports System.Web.UI.WebControls
Imports System.Web.UI
Imports System.ComponentModel

Namespace Grid
Public Class MyGrid
Inherits System.Web.UI.WebControls.WebControl

Protected Overrides Sub CreateChildCOntrols()
Dim tempTable As New Table()
Dim x As New TableCell()
Dim x1 As New TableCell()
Dim y As New TableRow()
x.Text = "test1"
x1.Text = "test2"
y.Cells.Add(x)
y.Cells.Add(x1)
tempTable.Rows.Add(y)
tempTable.Attributes.Add("border", "1")
Controls.Add(tempTable)
End Sub

Protected Overrides Sub render(ByVal output As
HtmlTextWriter)
EnsureChildControls()
RenderChildren(output)
End Sub
End Class
End Namespace



It generates a table, with 2 cells in one row.
I have few questions about it. I very much appreciate if
anyone can help me find answers to these questions?

1. How do I change the properties of the table in the
design mode?
2. I want to display my own properties. So, how do I
display "customizedtableheaders" under 'property'? How do
I display 2 sub properties (headertext1 & headertext2)
under "customizedtableheader"?
3. When I enter a string value to the "headertext1"
property in the design mode, I want that value to display
in the first cell in the table as a text in the design
mode. The same has to be done with the "headertext2" and
the second cell in the table. How do I do it?
4. How do make the width and the height of the table
change, by dragging it with the mouse?

Please reply me soon if you know the solutions. Thanks a
lot.
 
R

Rajesh.V

If u have msdn installed in ur system, this link will give u all the answers

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dnmag02/html/webc.htm
 
M

Mahesh

Idont have MSDN on my computer to check the help page that
you have sent me. i very much appriceate if you can send
me the part that i need in a zip file or in a word
document or you can send me the internet path in
msdn.microsoft.com to go to that help page.thank you very
much for your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top