CodeVerge.Net Beta


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

ASP.NET Web Hosting
3 Months Free and Free Setup - ASP.NET Web Hosting



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: 7/22/2005 4:00:11 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 65 Favorited: 0 Favorite
3 Items, 1 Pages 1 |< << Go >> >|
KrisV
Asp.Net User
Custom List Control7/22/2005 4:00:11 AM

0/0

Hi all,

here's a little thing that I'd really like to work out ... I'm tryiong to create a custom listcontrol (ListBox) that has an extra value field
after much research I found out that ListItem is sealed so I wrote my own imp which works perfectly after this I created a custom collection for the "DoubleListItem" obj

now the bit thats not falling into place I need to work out how to use my collection for the custom control instead of base.Items (yep trying to use listbox to save time)  
and it does work as it is .. but the control as two collections the derived one from ListBox (base.Items / MyControl.Items) and mine (SmartControls.DoubleItems / MyControl.DoubleItems)
 
can I get rid of it somehow... or should I just ignore it? 
 
DoubleItems does use IStateManager to keep track of its own Viewstate ...

any one that has any ideas or comments or the idea please feel free to comment.
 
P.S unless im missing something I dont need it and guessing it'd be awful confusing to a third party using the control

Thanks in Adv,

Kris V

-=Will this Ever Changing World Ever be Different?=-
billrob458
Asp.Net User
Re: Custom List Control7/22/2005 2:51:55 PM

0/0

When I have needed an extra "value" for a ListItem, I have just used the AttributeCollection of the ListItem.

ListBox listBox;

foreach( DataRow row in dataTable.Rows )
{
   ListItem item = new ListItem();
   item.Value = row["Value"].ToString();
   item.Text = row["Text"].ToString();
   item.Attribute["Value2"] = row["Value2"].ToString();   
   listBox.Items.Add( item );
}


Then for retrieval of the value:

ListItem item = listBox.SelectedItem;
string text = item.Text;
string value = item.Value;
string value2 = item.Attributes["Value2"];


Now the only thing to watch for is the attribute values are not serialized to viewstate automatically.  I would recommend, rather than your custom ListItem, that you derive from your list control (ListBox or DropDownList), and override the SaveViewState and LoadViewState methods to save the attribute values and reload them.  You can easily comment these methods out to explain why and what they are doing for future support.

If you need help with overriding the ViewState management let me know, but that is the direction I would take.

bill
KrisV
Asp.Net User
Re: Custom List Control8/1/2005 6:04:00 AM

0/0

Hi Bill,

Sorry its taken me ahwile to answer again and thanks for your help .... however the reason behind the custom list control is so that two seperate items are actually displayed in the listbox i.e 10      Pears       $100 where each element is a seperate value I suppose this could just be emluated i.e the text field is string+tab+string+tab+string and the store the values as attribs interesting idea however if anyone could solve this one it'd be great another problem is formatting inside the list control for some reason even if I have a Custom Formatter i.e {0,-62} it never works (it does in the raw html (i.e whitespace) but doesn't show in the listbox ?


thanks in Advance

Kris V


-=Will this Ever Changing World Ever be Different?=-
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
SharePoint 2003 User's Guide Authors: Seth Bates, Tony Smith, Pages: 340, Published: 2005
SharePoint 2007 User's Guide: Learning Microsoft's Collaboration and Productivity Platform Authors: Seth Bates, Tony Smith, Pages: 407, Published: 2007
Pro .NET 2.0 Windows Forms and Custom Controls in C#: From Professional to Expert Authors: Matthew MacDonald, Pages: 1037, Published: 2005
SharePoint User's Guide Authors: Bryan Acker, Infusion Development Corporation, Tyler Davey, Robert McGovern, Infusion Development Corporation, Pages: 136, Published: 2005
Windows XP for Dummies Authors: Andy Rathbone, Pages: 432, Published: 2004
Microsoft Office Project Server 2007: The Complete Reference Authors: Dave Gochberg, Rob Stewart, Pages: 647, Published: 2008
Expert One-on-One Visual Basic 2005 Design and Development Authors: Rod Stephens, Pages: 620, Published: 2007
User Interfaces in C#: Windows Forms and Custom Controls Authors: Matthew MacDonald, Pages: 586, Published: 2002
Special Edition Using Microsoft Office 2003, Student-Teacher Edition: Student-teacher Authors: Ed Bott, Woody Leonhard, Pages: 902, Published: 2006
Writing Excel Macros with VBA: Learning to Program the Excel Object Model with VBA Authors: Steven Roman, Pages: 549, Published: 2002

Web:
Custom List Controls :: DotNetJohn Jan 19, 2006 ... It’s actually pretty easy to create a custom list control, with intellisense support. Additional code stores the list in viewstate, ...
A Custom Drawn List Control in C++ A Custom Drawn List Control in C++. (Page 1 of 3 ) In this article Vitali takes the standard C++ list control and modifies it to extend its functionality. ...
CodeProject: Adding validation to a custom list control in ... Jul 29, 2008 ... validation can be achieved from inside the sharepoint designer; Author: Rajan Bhanot; Section: SharePoint Server; Chapter: Enterprise ...
Custom ListControl type WebControl (DropDownList, CheckBoxList ... You need to implement a collection in your custom CheckBoxList control to hold the child object such as list items. ...
CodeProject: A custom list view control with custom scrollbar ... This article is intended to show an opportunity for customizing the list view control (report view, single-line mode) using the custom scrollbar control.; ...
Safari Books Online - 0768666783 - ASP.NET 2.0 Unleashed Creating a Custom List Control. All the List controls inherit from the base ListControl class ... In this section, we create a custom List control named the ...
Custom List Control - Scrolling causes blurs and duplicates of ... Good day, I have created a custom list control that I use to display information . It contains a checkbox in one column and an edit box in another field.
Inherit from a custom ListControl each control or I could, smartly, add the properties to a custom ListControl class which they all inherit from. The problem is that ...
Building a Custom List using the Persona WPF Presence Control ... Oct 6, 2008 ... This post will demonstrate how to build a simple custom WPF ListBox that uses the Persona control and binds to a custom collection. ...
VBDork.NET - Custom List Box Control with DblClick for Click and ... Aug 11, 2008 ... Extending the listbox control with a doubleclick event.

Videos:
How to put custom songs in guitar hero 3! How to put custom songs in guitar hero 3! it is finnaly here! follow steps carefully ! if you have any problems post a video response! Chart to Mid ...
Rear Airbag Assist Kit Custom Control Center I made this control center to replace the cigarette lighter since I don't smoke. Gauges are in PSI and the left is bag pressure, right is tank pressu...
Microsoft Excel 2000 Volume III Training and Help Managing Lists and Working with Data - Introduction to Excel 2000 Volume III - Introduction to Segment 1 - Launching Excel 2000 and Retrieving a File...
GeneralTJI's 2002 WRX Wagon vf39 E85 Custom Exhaust Clip 4" Downpipe, 3.5" exhaust w/ 3.5" Dynomax Bullet mufflers running 19psi on E85. STi Turbo / IC / splitter, rebuilt motor, headers, wideband, gauges, ...
Custom Game lobby - Halo 3 http://ProjectModGaming.com Description: This glitch allows you to get into the custom game lobby and check out all the possible options,maps, and ...
Microsoft Excel 2000 Volume III Training and Help Managing Lists and Working with Data - Introduction to Excel 2000 Volume III - Introduction to Segment 1 - Launching Excel 2000 and Retrieving a File...
IT-Dev View Filtered Lookup for SharePoint 2007 http://www.it-dev.pl/en/Components/SharePoint_Filtered_Lookup.aspx View Filtered Lookup allows you to create a lookup column that points to a view o...
Custom Built Subaru Legacy Spec B Turbo Who says STI's get to have all the fun? Mod List: 458 WHP ( 598 Crank HP) @ 20.5psi Sti Shortblock with legacy heads Sti Intake Manifold Perrin fuel ...
Microsoft Excel 2000 Volume III Training and Help Managing Lists and Working with Data - Introduction to Excel 2000 Volume III - Introduction to Segment 1 - Launching Excel 2000 and Retrieving a File...
Let Excel recognize your data as a List Excel introduced the valuable - but underutilized - List COmmand in version 2003. If you use AutoFilter or Custom Filter, you should take a few minu...












wiring up an event handler automatically for any instance of a custom control

displaying child controls of a template item at design time

arraylist help!!!

windows server 2003 sp1

overriding the render() method

designer context

sql server 2005 express edition hosting!!!!!!!!!!!!

default value on override and custom property

custom control for datagrid. onselectedindexchanged event problem.

dns configuration for external dns servers

matt fleitz, about your software download

how to config ftp for website?

help: control

getting a control as xml

hosting company support for sql server & membership login, createuser controls

dropdown list with checkbox

how do i load and render a aspx resource

can i build my own webcontrols?

mass event processing suggestion

which one is better custom control or user control

a reference to a user control in vb

postback displeasures

cheap hosting?

web user control

returning the height of an embedded user control

server intellect

custom composite control and databinding

problem importing control in asp.net 2.0

inherit label control - reuse label designer

persisting a data control designers properties across multiple classes

  Privacy | Contact Us
All Times Are GMT