473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Creating an Item property for a custom control

Hi,

I created a custom control, but I can't add an item property to it. I
tried the code below, but when I click the property, it shows a list of
Objects. I can't figure out how to have items to hold only integers.
Even with Objects, they seem to be readonly. I can't assign values to
them.

<Bindable(True), Category("Data"), DefaultValue("Item")> Property
[Item]() As ArrayList
Get
Return mDataList
End Get

Set(ByVal Value As ArrayList)
mDataList = Value
End Set
End Property

Any help is appreciated.

Thanks
Wael

Sep 21 '05 #1
1 1480
To create a default indexer, use something like:
Public Default Property Item(ByVal index As Integer) As Integer
Get
Return yourlist(index)
End Get
Set
yourlist(index) = Value
End Set
End Property
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter
Clear VB: Cleans up outdated VB.NET code
"Wael" wrote:
Hi,

I created a custom control, but I can't add an item property to it. I
tried the code below, but when I click the property, it shows a list of
Objects. I can't figure out how to have items to hold only integers.
Even with Objects, they seem to be readonly. I can't assign values to
them.

<Bindable(True), Category("Data"), DefaultValue("Item")> Property
[Item]() As ArrayList
Get
Return mDataList
End Get

Set(ByVal Value As ArrayList)
mDataList = Value
End Set
End Property

Any help is appreciated.

Thanks
Wael

Sep 21 '05 #2

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

Similar topics

3
by: Ken Varn | last post by:
I am just starting the process of creating ASP.NET server controls. I have created controls for .NET applications, but have just started with ASP.NET. I am a little confused about some areas that...
2
by: Kel Good | last post by:
Hello, I am binding a custom IList object to a DataList that I am using for a web menu. The items in the custom IList have properties that allow me to dynamically define how my menu behaves. My...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
1
by: Wael | last post by:
Hi, I created a custom control, but I can't add an item property to it. I tried the code below, but when I click the property, it shows a list of Objects. I can't figure out how to have items to...
0
by: Julien | last post by:
Hi ! I'm creating a custom control, in which I would render an image with client-side script code to display/hide a calendar control which also belong to my custom control. In this control I've...
7
by: =?Utf-8?B?YnJhaW5mdWVsbWVkaWE=?= | last post by:
Can anyone point me in the direction of creating a custom listview item? I guess the other question then - is this possible? I want to create a list of listview items comprised each comprised of...
3
by: Allan Ebdrup | last post by:
I get the error "Error creating control: ID property is not specified" when I view my custom web control in design view. I add the control that gives an error in OnInit like this: ----- foreach...
1
by: Isai | last post by:
Hello, I am using VB.NET in Visual Studio 2005 to develop ASP.NET 2.0 web applications. I am developing a control library with all the custom controls that I can use in my projects. One of the...
1
by: deepapanch | last post by:
Hi All: I am new to C#. Have created a simple outlook add-in, which adds a command bar in Outlook. On click of the button, I would like to load the a simple dialog with a Text Box and a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.