Bug: when you select an item before add to a listbox.

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
0
0

 

 

When you select an item before added to a listbox, this is not selected.

 

If condtion =1 then

lv.Selected = True

end if

List.Items.Add(lv)

 

Al the items are unselected.

 

  • You must to post comments
0
0

Hi Mark,

WJ-8003 is also fixed in the latest Wisej release (1.3.35).

Best regards
Frank

  • You must to post comments
0
0

Got it! Logged it as WJ-8003. Unfortunately I don’t have an easy workaround.

  • You must to post comments
0
0

 

Ok, I know the problem (difference between SelectionMode “One” and “MultiSimple”).

The problem is that my function to fill the ListBox is in the “Load” event of my form… maybe is the time to draw the selection.

Curiously the “One” work in the Load event, but not “MultiSimple”.

With MultiSimple………

If I put a button for select the item, this works.

If I put a timer for select the item (in the Load event), this works…. (This will be my solution for now).

 

You can try, also is the same problem in your attached code.

 

Thanks.

 

  • You must to post comments
0
0

 

 

So strange… in your code works!, but in my code only works with the “One” option.

  • Luca (ITG)
    Can you send a test case? Check also chrome’s log (F12) to see if there are error on the client side.
  • You must to post comments
0
0

Can you reproduce with the sample I have attached?

I added SelectionMode=SelectionMode.MultiSimple to both the ListView and ListBox in the sample and still works. Maybe it was fixed in the current code base.

  • You must to post comments
0
0

 

 

I found the problem…

The selection like you say is working only with the “SelectionMode=One”

I’m using the “SelectionMode=MultiSimple” and not working… (visually).

 

Try it!, maybe is a little bug

 

  • You must to post comments
0
0

 

 

Ok, I know the problem.

 

Maybe something with the theme??

If i ask for the selected items, yes it is selected.. but not visually.

 

The visual selection works only with the “click”… maybe some bad with my theme?

 

 

 

  • You must to post comments
0
0

I’m not sure I understand. From the┬ácode you posted looks like you are adding a ListViewItem objects to a ListBox and when you select the item it doesn’t work? Or are you adding the items to a ListView and try to select the in a ListBox? You can’t select an item in the ListBox and expect to see it selected also in the ListView.

I tried a small sample and it all works fine – If I understood what you are trying to do. If you attach a small sample we can make sure we are looking at the same thing.

The example creates 5 ListViewItem instances and adds them to a ListView and to a ListBox. Selecting the index (listiew) or item (listbox) works well. Selecting in one control will *not* affect the other control, which is also correct.

  • You must to post comments
0
0

 

 

Is an “ListItem”.

But not… the selection dynamically is not working.

 

I tried everything..

After i add all my items to listview…

I tried

ListBox.SelectedIndex = 52

And nothing…

And ListBox.SelectedItem = vSel (my item object)

and nothing…

 

 

  • Luca (ITG)
    ListBox or ListView?
  • You must to post comments
0
0

What type is lv?

In general, a ListBox accepts anything as an item and item’s properties are not related to the ListBox at all. The only way to select a ListBox item is to use ListBox.SelectedItem or ListBox.SelectedIndex.

  • You must to post comments
Showing 10 results
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 1, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json