Help with listbox

Help with listbox

am 12.01.2008 23:30:17 von glbdev

Hi.

I am trying to loop thru a listbox and retreive the value for all
selected items.

Example of listbox items:






Here is an example of the code used to parse the listbox:

If Me.lstSelectedIssues.Items.Count = 0 Then Return String.Empty
For x = (Me.lstSelectedIssues.Items.Count - 1) To 0 Step -1
sBuffer += Me.lstSelectedIssues.Items(x).Value + ","
Next

I keep getting the TEXT ('Item1") instead of the NUMERIC (1) values
from these items.

What am I doing wrong?

Thanks,
Steve

Re: Help with listbox

am 13.01.2008 14:25:14 von Joe Chung

Your code looks fine. What sort of server-side control are you using for
your multi-select list box, and how are you populating it?

wrote in message
news:fc2cb014-d07f-418f-9624-21f5f097f432@k2g2000hse.googleg roups.com...
> Hi.
>
> I am trying to loop thru a listbox and retreive the value for all
> selected items.
>
> Example of listbox items:
>
>
>
>
>
>
> Here is an example of the code used to parse the listbox:
>
> If Me.lstSelectedIssues.Items.Count = 0 Then Return String.Empty
> For x = (Me.lstSelectedIssues.Items.Count - 1) To 0 Step -1
> sBuffer += Me.lstSelectedIssues.Items(x).Value + ","
> Next
>
> I keep getting the TEXT ('Item1") instead of the NUMERIC (1) values
> from these items.
>
> What am I doing wrong?
>
> Thanks,
> Steve

Re: Help with listbox

am 13.01.2008 18:26:47 von glbdev

On Jan 13, 8:25=A0am, "Joe Chung" wrote:
> Your code looks fine. =A0What sort of server-side control are you using fo=
r
> your multi-select list box, and how are you populating it?
>
> wrote in message
>
> news:fc2cb014-d07f-418f-9624-21f5f097f432@k2g2000hse.googleg roups.com...
>
>
>
> > Hi.
>
> > I am trying to loop thru a listbox and retreive the value for all
> > selected items.
>
> > Example of listbox items:
> >
> >
> >
> >
> >
>
> > Here is an example of the code used to parse the listbox:
>
> > If Me.lstSelectedIssues.Items.Count =3D 0 Then Return String.Empty
> > =A0 =A0 =A0For x =3D (Me.lstSelectedIssues.Items.Count - 1) To 0 Step -1=

> > =A0 =A0 =A0 =A0 =A0 =A0sBuffer +=3D Me.lstSelectedIssues.Items(x).Value =
+ ","
> > =A0 =A0 =A0Next
>
> > I keep getting the TEXT ('Item1") instead of the NUMERIC (1) values
> > from these items.
>
> > What am I doing wrong?
>
> > Thanks,
> > Steve- Hide quoted text -
>
> - Show quoted text -

Thanks for responding. I am populating the box using a SQLDataSource.

Steve