By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,007 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,007 IT Pros & Developers. It's quick & easy.

Listview cannot add listviewitem

P: n/a
I have a listview defined a coloumn at design time.

And the code I use to add a listviewitem:
ListViewItem lvi = new ListViewItem(user.Name);

lvi.Tag = (Object)user.Id;

lvUsers.Items.Add(lvi);

However, the listviewitem could not be added successfully.

If I removed the column settings, ie remove the columns at design time, then
the listviewitem can be added.

Why ?
Jul 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

IIRC the only time when y ou cannot use Items.Add is when you have the
control binded to some datasource.
Setting the columns have no impact on it.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Alan T" <al*************@yahoo.com.auwrote in message
news:uz**************@TK2MSFTNGP04.phx.gbl...
>I have a listview defined a coloumn at design time.

And the code I use to add a listviewitem:
ListViewItem lvi = new ListViewItem(user.Name);

lvi.Tag = (Object)user.Id;

lvUsers.Items.Add(lvi);

However, the listviewitem could not be added successfully.

If I removed the column settings, ie remove the columns at design time,
then the listviewitem can be added.

Why ?


Jul 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.