473,396 Members | 2,106 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,396 software developers and data experts.

ListItem namespace/ref

Hi all,
I am using VS 2005 Beta 2. Which assembly (namespace?) should I use for the
ListItem class? I don't have the Help files installed on my notebook for
space reasons; I use MSDN2 online instead. I see ListItem as derived from
System.Web.UI.Controls namespace. Am I missing something here? I am
creating a Windows application by the way.
Nov 17 '05 #1
7 17732
Amil,

It's in the System.Web.UI.WebControls namespace.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Amil" <Am**@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
Hi all,
I am using VS 2005 Beta 2. Which assembly (namespace?) should I use for
the
ListItem class? I don't have the Help files installed on my notebook for
space reasons; I use MSDN2 online instead. I see ListItem as derived from
System.Web.UI.Controls namespace. Am I missing something here? I am
creating a Windows application by the way.

Nov 17 '05 #2
Amil,

Wait, how come you are using web controls for a windows project?

Are you sure you don't want the ListViewItem class in the
System.Windows.Forms namespace?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Amil" <Am**@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
Hi all,
I am using VS 2005 Beta 2. Which assembly (namespace?) should I use for
the
ListItem class? I don't have the Help files installed on my notebook for
space reasons; I use MSDN2 online instead. I see ListItem as derived from
System.Web.UI.Controls namespace. Am I missing something here? I am
creating a Windows application by the way.

Nov 17 '05 #3
I am using a ListBox control.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Amil,

Wait, how come you are using web controls for a windows project?

Are you sure you don't want the ListViewItem class in the
System.Windows.Forms namespace?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Amil" <Am**@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
Hi all,
I am using VS 2005 Beta 2. Which assembly (namespace?) should I use for
the
ListItem class? I don't have the Help files installed on my notebook for
space reasons; I use MSDN2 online instead. I see ListItem as derived from
System.Web.UI.Controls namespace. Am I missing something here? I am
creating a Windows application by the way.


Nov 17 '05 #4
Amil,

If that is the case, then you can add anything as an item to the
control. The ToString method is called on the item, and that is used to
populate the list.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Amil" <Am**@discussions.microsoft.com> wrote in message
news:F7**********************************@microsof t.com...
I am using a ListBox control.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Amil,

Wait, how come you are using web controls for a windows project?

Are you sure you don't want the ListViewItem class in the
System.Windows.Forms namespace?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Amil" <Am**@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
> Hi all,
> I am using VS 2005 Beta 2. Which assembly (namespace?) should I use
> for
> the
> ListItem class? I don't have the Help files installed on my notebook
> for
> space reasons; I use MSDN2 online instead. I see ListItem as derived
> from
> System.Web.UI.Controls namespace. Am I missing something here? I am
> creating a Windows application by the way.


Nov 17 '05 #5
Thanks Nicholas.

My problem really is how to evaluate the text of the selected item of the
listbox. It seems that I have to include the System.Web.UI.WebControls
namespace in my windows form, which kind of doesn't make sense, to be able to
create a ListItem object. An item in a ListBox evaluates to a ListItem
object, correct?
"Nicholas Paldino [.NET/C# MVP]" wrote:
Amil,

If that is the case, then you can add anything as an item to the
control. The ToString method is called on the item, and that is used to
populate the list.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Amil" <Am**@discussions.microsoft.com> wrote in message
news:F7**********************************@microsof t.com...
I am using a ListBox control.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Amil,

Wait, how come you are using web controls for a windows project?

Are you sure you don't want the ListViewItem class in the
System.Windows.Forms namespace?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Amil" <Am**@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
> Hi all,
> I am using VS 2005 Beta 2. Which assembly (namespace?) should I use
> for
> the
> ListItem class? I don't have the Help files installed on my notebook
> for
> space reasons; I use MSDN2 online instead. I see ListItem as derived
> from
> System.Web.UI.Controls namespace. Am I missing something here? I am
> creating a Windows application by the way.


Nov 17 '05 #6
Amil,

No, an item in the ListBox for Windows Forms does not evaluate to a
ListItem. It evaluates to object. You can store an object of any type in a
ListBox control for Windows Forms.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Amil" <Am**@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
Thanks Nicholas.

My problem really is how to evaluate the text of the selected item of the
listbox. It seems that I have to include the System.Web.UI.WebControls
namespace in my windows form, which kind of doesn't make sense, to be able
to
create a ListItem object. An item in a ListBox evaluates to a ListItem
object, correct?
"Nicholas Paldino [.NET/C# MVP]" wrote:
Amil,

If that is the case, then you can add anything as an item to the
control. The ToString method is called on the item, and that is used to
populate the list.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Amil" <Am**@discussions.microsoft.com> wrote in message
news:F7**********************************@microsof t.com...
>I am using a ListBox control.
>
> "Nicholas Paldino [.NET/C# MVP]" wrote:
>
>> Amil,
>>
>> Wait, how come you are using web controls for a windows project?
>>
>> Are you sure you don't want the ListViewItem class in the
>> System.Windows.Forms namespace?
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - mv*@spam.guard.caspershouse.com
>>
>> "Amil" <Am**@discussions.microsoft.com> wrote in message
>> news:68**********************************@microsof t.com...
>> > Hi all,
>> > I am using VS 2005 Beta 2. Which assembly (namespace?) should I use
>> > for
>> > the
>> > ListItem class? I don't have the Help files installed on my
>> > notebook
>> > for
>> > space reasons; I use MSDN2 online instead. I see ListItem as
>> > derived
>> > from
>> > System.Web.UI.Controls namespace. Am I missing something here? I
>> > am
>> > creating a Windows application by the way.
>>
>>
>>


Nov 17 '05 #7
Ok. Got it. Thanks.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Amil,

No, an item in the ListBox for Windows Forms does not evaluate to a
ListItem. It evaluates to object. You can store an object of any type in a
ListBox control for Windows Forms.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Amil" <Am**@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
Thanks Nicholas.

My problem really is how to evaluate the text of the selected item of the
listbox. It seems that I have to include the System.Web.UI.WebControls
namespace in my windows form, which kind of doesn't make sense, to be able
to
create a ListItem object. An item in a ListBox evaluates to a ListItem
object, correct?
"Nicholas Paldino [.NET/C# MVP]" wrote:
Amil,

If that is the case, then you can add anything as an item to the
control. The ToString method is called on the item, and that is used to
populate the list.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Amil" <Am**@discussions.microsoft.com> wrote in message
news:F7**********************************@microsof t.com...
>I am using a ListBox control.
>
> "Nicholas Paldino [.NET/C# MVP]" wrote:
>
>> Amil,
>>
>> Wait, how come you are using web controls for a windows project?
>>
>> Are you sure you don't want the ListViewItem class in the
>> System.Windows.Forms namespace?
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - mv*@spam.guard.caspershouse.com
>>
>> "Amil" <Am**@discussions.microsoft.com> wrote in message
>> news:68**********************************@microsof t.com...
>> > Hi all,
>> > I am using VS 2005 Beta 2. Which assembly (namespace?) should I use
>> > for
>> > the
>> > ListItem class? I don't have the Help files installed on my
>> > notebook
>> > for
>> > space reasons; I use MSDN2 online instead. I see ListItem as
>> > derived
>> > from
>> > System.Web.UI.Controls namespace. Am I missing something here? I
>> > am
>> > creating a Windows application by the way.
>>
>>
>>


Nov 17 '05 #8

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

Similar topics

4
by: mg | last post by:
How can I change the color of the display text beside a single ListItem of a RadioButtonList when the associated radiobutton is selected - hopefully using C# in the codebehind of a WebForm? ...
4
by: Shaul Feldman | last post by:
Hello, I have something really awkward at work - fighting with CheckBoxList... How can I define CSS for ListItem in CheckBoxList programmatically. I add CheckBoxList's Items on the fly, something...
2
by: Amelyan | last post by:
How can I assign an ID to dynamically generation ListItem that I add to dynamically generated CheckBoxList or RadioButtonList? I need to identify the specific ListItem later through Request.Form...
3
by: Nathan Sokalski | last post by:
I want to change the background color, font attributes, etc. of the choices in my DropDownLists. When writing them using HTML SELECT and OPTION tags, I can do something like the following: ...
0
by: sridev | last post by:
hi, I want to use Listitem class in windows application as in System.web.ui.webcontrol. what is the namespace to use the listitem in windows.Plx help me to solve the problem..... tell me how...
5
by: Mark Rae | last post by:
Hi, Has the <asp:DropDownList> - <asp:ListItem> functionality changed in v2? In v1.1, the following works as expected: <asp:DropDownList ID="cmbStatus" Runat=server EnableViewState=False>...
4
by: Kevin Blount | last post by:
As mentioned before, I'm creating a multi-lingual page where the text of the page comes from a database. This page includes a registration form which asks for address information, including the...
7
by: Jim in Arizona | last post by:
Using this: <asp:ListItem Value="0"</asp:ListItem> as long as I have a value listed and leave the area between the tags blank, when viewed the DropDownList will show a 0 as a choice. I want it...
5
by: ssmeshack | last post by:
Hi All, Im using VWD 2008 (c#), I have a question here. Im having a dropdownlist like this: <asp:DropDownList ID="ddlIssue" runat="server" AutoPostBack="True" ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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,...

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.