CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 12/3/2003 2:25:16 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 18 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
rajesh_gande
Asp.Net User
composit custom webcontrol12/3/2003 2:25:16 AM

0/0

I created a composite control using three dropdownListBoxes. it has one property "SelectedTime" to show specific time in the control. the control is working properly. i am able to add the control to the toolbox and to a page. the problem is that i am not able to (drag) the control on the web form.when ever i double click on the contol in the toolbox it is creating the control in upper left coner of the page. From There i am not able to move(drag) the control.

i understood the problem. my control is not having style proporty like other web control. if my understanding is correct please help me in adding the style property to my control. Is there any other way to solve my problem? please help me. below i am posting my code....


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

<DefaultProperty("SelectedTime"), ToolboxData("<{0}:RajeshTimePicker runat=server></{0}:RajeshTimePicker>")> Public Class RajeshTimePicker
Inherits System.Web.UI.Control
Implements INamingContainer


Dim Hrdblist As New DropDownList()
Dim Mindblist As New DropDownList()
Dim AMPMdblist As New DropDownList()


<Bindable(True), Category("Appearance"), DefaultValue("")> Property SelectedTime() As String
Get
Dim vTimeStr As String
vTimeStr = Hrdblist.SelectedItem.Text & ":" & Mindblist.SelectedItem.Text & _
AMPMdblist.SelectedItem.Text
Return vTimeStr

End Get

Set(ByVal Value As String)
EnsureChildControls()
'_text1 = Value
showtime(Value)
End Set
End Property


Protected Overrides Sub CreateChildControls()

popdblists()
Dim Hrlabel As New Label()
Hrlabel.Text = "HR"
Dim Minlabel As New Label()
Hrlabel.Text = "MIN"
Dim emtlabel As New Label()
Hrlabel.Text = " "
Controls.Add(Hrlabel)
Controls.Add(Hrdblist)
Controls.Add(Minlabel)
Controls.Add(Mindblist)
Controls.Add(emtlabel)
Controls.Add(AMPMdblist)

End Sub

Private Function showtime(ByVal fvdatetime)

If (fvdatetime Is "empty") Then
Hrdblist.SelectedIndex = 0
Mindblist.SelectedIndex = 0
AMPMdblist.SelectedIndex = 0
Else

Dim moment As DateTime = fvdatetime

Dim vHr As Integer = moment.Hour
Dim vMin As Integer = moment.Minute

If vHr = 12 Then
Hrdblist.SelectedIndex = 12
Else
Hrdblist.SelectedIndex = (vHr Mod 12)

End If

Mindblist.SelectedIndex = vMin / 5

If vHr / 12 > 1 Then
AMPMdblist.SelectedIndex = 1
Else
AMPMdblist.SelectedIndex = 0
End If
End If
End Function
Private Sub popdblists()
Hrdblist.Items.Add("00")
Hrdblist.Items.Add("01")
Hrdblist.Items.Add("02")
Hrdblist.Items.Add("03")
Hrdblist.Items.Add("04")
Hrdblist.Items.Add("05")
Hrdblist.Items.Add("06")
Hrdblist.Items.Add("07")
Hrdblist.Items.Add("08")
Hrdblist.Items.Add("09")
Hrdblist.Items.Add("10")
Hrdblist.Items.Add("11")
Hrdblist.Items.Add("12")

Mindblist.Items.Add("00")
Mindblist.Items.Add("05")
Mindblist.Items.Add("10")
Mindblist.Items.Add("15")
Mindblist.Items.Add("20")
Mindblist.Items.Add("25")
Mindblist.Items.Add("30")
Mindblist.Items.Add("35")
Mindblist.Items.Add("40")
Mindblist.Items.Add("45")
Mindblist.Items.Add("50")
Mindblist.Items.Add("55")


AMPMdblist.Items.Add("AM")
AMPMdblist.Items.Add("PM")

End Sub
End Class
joteke
Asp.Net User
Re: composit custom webcontrol12/4/2003 7:16:20 AM

0/0

Put the control to derive from System.Web.UI.WebControls.WebControl. Do you want the style then to apply to child controls somehow?
Thanks,

Teemu Keiski
Finland, EU
rajesh_gande
Asp.Net User
Re: composit custom webcontrol12/7/2003 6:02:56 PM

0/0

it is woring... thank you for ur help...
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional Web Parts and Custom Controls with ASP.NET 2.0 Authors: Peter Vogel, Pages: 449, Published: 2005
Pro ASP. Net 3. 5 Server Controls and AJAX Components Authors: Rob Cameron, Dale Michalk, Pages: 740, Published: 2008
Professional ASP.NET 2.0 Server Control and Component Development Authors: Shahram Khosravi, Pages: 1186, Published: 2006
ASP.NET Kick Start: Kick Start Authors: Stephen Walther, Pages: 624, Published: 2002
Programming Visual Basic 2005 Authors: Jesse Liberty, Pages: 548, Published: 2005
Visual Basic .NET Power Coding Authors: Paul Kimmel, Pages: 708, Published: 2003
Visual Basic .NET Unleashed Authors: Paul Kimmel , Pages: 0, Published: -1
Programming ASP.NET: Building Web Applications and Services Using C and VB.NET. Authors: Jesse Liberty, Dan Hurwitz, Pages: 988, Published: 2003
Developing and Implementing Web Applications with Visual Basic .NET and Visual Studio .NET: Exam Cram 2, 70-305 Authors: Kirk Hausman, Mike Gunderloy, Ed Tittel, Pages: 624, Published: 2003
Developing Web Applications with Visual Basic.NET and ASP.NET Authors: John Alexander, Billy Hollis, Pages: 400, Published: 2002

Web:
CodeGuru: Composite Custom Web Controls in Managed C++ Also, because a composite custom Web control resides in its own assembly, ... Now, you are ready to create your new composite custom Web control. ...
Composite Custom Web Controls in Managed C++ A composite custom Web control is exactly what its name suggests: a composite of one ... Now, you are ready to create your new composite custom Web control. ...
CodeProject: Building an ASP.NET custom web control: a textbox and ... In this article we will have a look at implementing a custom web control. ... seen how beneficial it can be to create your own composite custom control. ...
Programming ASP.NET: Custom and User Controls, Part 2 | O'Reilly Media Create a full custom control by deriving from System.Web.UI.WebControls. WebControl. Composite controls are most similar to user controls. ...
DUNN Training and Consulting - Custom Web Control Development Composite Webcontrols. Review of what and why. ... teaches the most straight forward, common, and enjoyable to write custom control, the Composite Control. ...
Custom Web Control w/ Child Composite Controls - Element not ... Custom Web Control w/ Child Composite Controls - Element not supported. Last post 03-02-2008 7:42 PM by exsurgo. 4 replies. Sort Posts: ...
How to build a simple List to List Composite Web Control Summary: List2List custom composite web control enables a developer to bind ... In order to build our own composite custom web control we need a class that ...
Composite Web Control Example A composite control uses child controls to create a user interface (UI) and to ... Developing Custom ASP.NET Server Controls ยท Composite Web Control Example ...
Safari Books Online - 9780735623347 - MCTS Self-Paced Training Kit ... composite control A composite control is a custom Web control that can contain constituent controls; the constituent controls are added to the composite ...
CodeProject: Managing ViewState, Rendering and Events in Composite ... got problem with my composite custom web control.. I have custom datagrid control within another custom panel control.. datagrid has two buttoncolumns and i ...




Search This Site:










awkward situation

raising button_onclick event programatically

ip address

.net and java

dnn4.0 installation - object reference not set to an instance of an object.

managing membership of different web application.

viewstate error with module and inline editing

how to implement common bad word filter in dnn ?

detailed comparison between asp and asp.net

urgent button event never fires

sharepoint 2.0 customization

is there a page options module for dnn

cannot reply forum?

saving layout structure

is it possible to mix the membership and role providers?

skinobject vs module ?

how to convert textbox value into datetime variable?

custom web control and collection: can't edit properties

ibuyspy workshop behind isa firewall

how to do "select top 1 customer from customers" in linq to sql?

regarding security warning while trying to run an executable and digital signature

dollars and cents

installing the windows service on a non-developement system?

general exception reoccurring for the gallery in log viewer in dnn 3.0.12

webparts on many places

problem to use treeview control in a 'content page' this error occur "only content controls are allowed directly in a content page that contains content controls."

trouble passing parameter to array list

where is cookie stored when using forms authentication / admembershipprovider

formsauthenticationticket

print area - part of module

 
All Times Are GMT