CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 1/24/2005 4:09:00 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 4 Views: 568 Favorited: 0 Favorite
5 Items, 1 Pages 1 |< << Go >> >|
DrEaMON
Asp.Net User
How to create a custom dropdownlist webcontrol in C#1/24/2005 4:09:00 PM

1

Hi,

I want to create a custom dropdownlist with type-ahead functionality embedded in it.
So, I need to inherit the DropDownList class from the System.Web.UI.WebControls namespace.

I just want to get a kick-start to how I do this. I mean, I just need a small recipe to how I start. What kind of project do I start, what kind of template do I choose? Which methods do I HAVE to override to get the basic functionality of the dropdownlist?

Thanks!!
I haven't failed, I've found 10,000 ways that don't work
PLBlum
Asp.Net User
Re: How to create a custom dropdownlist webcontrol in C#1/24/2005 7:13:57 PM

0

1. The ASP.NET DropDownList creates the HTML tag <select>. The browser has a specific feature set for <select> and this imposes real limits.
2. The work you will do is client-side code using JavaScript. You will learn how to use DHTML (the document object model of Internet Explorer) and if you want Mozilla/FireFox support, DOM.
3. You will intercept keypress events using the onkeypress event handler available on <select>. Your code will look at event.keyCode to find out what key was pressed. Then you will take whatever action needed to consolidate the keystrokes into a string, search the <select> tag's <option> list to find a match then set its selectedIndex property.

Recommendation: ASP.NET has a rich variety of third party controls that are debugged and enhanced based on user feedback. Some are free. You can find many nice enhancements for your user interface, like menus, datepickers, validators, datagrids, and richtextboxes. There are several improved dropdownlists, usually characterized as "comboboxes". You can find them at this site's Control Gallery, www.123aspx.com, and www.411asp.net.
--- Peter Blum
Creator of Professional Validation And More Suite, Peter's Date Package, and Peter's Polling Package
www.PeterBlum.com
DrEaMON
Asp.Net User
Re: How to create a custom dropdownlist webcontrol in C#1/24/2005 8:13:30 PM

0

Thanks, but I was more looking for a step-by-step guide to how I create a project and the .cs file in Visual Studio. I need to know what kind of project and what kind of .cs file I have to choose (what templates that is).

Furthermore, I need to know, if any, which methods in the class I have to override (from the inherited DropDownList class) to make my new custom control have the exact same functionality as the 'original' DropDownList.

Thanks!
I haven't failed, I've found 10,000 ways that don't work
PLBlum
Asp.Net User
Re: How to create a custom dropdownlist webcontrol in C#1/25/2005 12:28:38 AM

0

It sounds like you don't have the .net documentation for Visual Studio.net. Please be sure to have that. Its very easy to guess though:
File menu; New Project.
Pick your language
Web Control Library

To know what to override, you really need to read the .net documentation. Its a big project, not something we can (or should) teach here. I recommend the book "Developing ASP.NET Server Controls and Components" from Microsoft Press. But the .net docs is how I learned.

To know *how* to override a DropDownList, you must know how to develop object oriented code in your preferred language. You can easily just subclass without overriding a method and have a new control class name that has the identical functionality.
--- Peter Blum
Creator of Professional Validation And More Suite, Peter's Date Package, and Peter's Polling Package
www.PeterBlum.com
DrEaMON
Asp.Net User
Re: How to create a custom dropdownlist webcontrol in C#1/25/2005 8:39:41 AM

0

Allright, thanks! You gave me the small push that I needed!
I haven't failed, I've found 10,000 ways that don't work
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional C# 2008 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Pages: 1782, Published: 2008
Sams teach yourself C# Web programming in 21 days Authors: Phil Syme, Peter Aitken, Pages: 535, Published: 2001
PROFESSIONAL C# 2005 Authors: Christian Nagel, Bill Evjen, Pages: 1540, Published: 2005
Pro ASP.NET 2.0 in VB 2005: special edition. Authors: Laurence Moroney, Matthew MacDonald, Pages: 1360, Published: 2006
C# Web development with ASP.NET Authors: Jose Mojica, Pages: 435, Published: 2003

Web:
How to create a custom dropdownlist webcontrol in C# - ASP.NET Forums I want to create a custom dropdownlist with type-ahead functionality embedded in it. So, I need to inherit the DropDownList class from the ...
DropDownList.BorderColor Property (System.Web.UI.WebControls) For information about how to use custom server controls, ... < title>Custom DropDownList - BorderColor - C# Example






hi - opinions on this list of 3 hosts?

composite control - cleaning up ?

xml inside the control tags

printing a webform from asp.net

control that will allow selection and drag and drop

does excel need to be installed on server

required field validator in control wrongfully triggering

error - a control cannot modify its parents' control collections

could someone recommend a good dedicated hosting provider

passing data to parent control.

creating template datagrid column dynamically work just for last row

beginner hosting suggestion with asp.net and sql server 2005 express edition

"newly submitted" controls, control gallery top page

client script for custom control and custom validation

a little extra help on user controls.

accessing containing page variables

about webcontrol easy problem..

panel, paneldesigner & getdesigntimehtml

send email with godaddy??

design time events in web controls

render won't render...

help selecting a web hosting company

looping through objects inside a custom control

collectioneditor for extended panels

building a data-bound templated control

how can i create webcontrol property of type class?

domain registration in india

radiobuttonlist in composite control

usercontrol and checkbox

get value from hidden and getdesgintimehtml

   
  Privacy | Contact Us
All Times Are GMT