471,354 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Weird

Hi All Pro,

I try to delete item from the listbox control, but I am always got this
error message after the item was removed from the list:

" There is no row at position 0 "

Here is how I do it:

listbox1.Items.RemoveAt( listbox1.SelectedIndex );

listbox1.ClearSelected();

Any help is greatly appreciated. Thanks you all in advance...

Kate
Feb 2 '06 #1
3 1297
If the ListBox is empty, there is no row at position 0. There is no row
period.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"cql90" <cq***@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Hi All Pro,

I try to delete item from the listbox control, but I am always got this
error message after the item was removed from the list:

" There is no row at position 0 "

Here is how I do it:

listbox1.Items.RemoveAt( listbox1.SelectedIndex );

listbox1.ClearSelected();

Any help is greatly appreciated. Thanks you all in advance...

Kate

Feb 2 '06 #2
Thanks you so much Kevin, I am very appreciated. Take care and have a nice
day...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Ot*************@TK2MSFTNGP12.phx.gbl...
If the ListBox is empty, there is no row at position 0. There is no row
period.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"cql90" <cq***@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Hi All Pro,

I try to delete item from the listbox control, but I am always got this
error message after the item was removed from the list:

" There is no row at position 0 "

Here is how I do it:

listbox1.Items.RemoveAt( listbox1.SelectedIndex );

listbox1.ClearSelected();

Any help is greatly appreciated. Thanks you all in advance...

Kate


Feb 2 '06 #3
Make sure and check the count before you try to delete any rows.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"cql90" <cq***@yahoo.com> wrote in message
news:e4**************@TK2MSFTNGP09.phx.gbl...
Thanks you so much Kevin, I am very appreciated. Take care and have a nice
day...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Ot*************@TK2MSFTNGP12.phx.gbl...
If the ListBox is empty, there is no row at position 0. There is no row
period.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"cql90" <cq***@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Hi All Pro,

I try to delete item from the listbox control, but I am always got this
error message after the item was removed from the list:

" There is no row at position 0 "

Here is how I do it:

listbox1.Items.RemoveAt( listbox1.SelectedIndex );

listbox1.ClearSelected();

Any help is greatly appreciated. Thanks you all in advance...

Kate



Feb 2 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Gabriel Afana | last post: by
3 posts views Thread by redneck_kiwi | last post: by
82 posts views Thread by nobody | last post: by
reply views Thread by P Pulkkinen | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.