Skip to main content

Microsoft Silverlight

Answered Question highlighted selected items in listbox RSS Feed

(0)

rohitnegi09
rohitnegi09

Member

Member

2 points

63 Posts

highlighted selected items in listbox

how to highlighted the selected items in listbox but more than 2 items should be higlighted at a time.

means seelct one item then that will highlighted and next item selected than that will highlighted but first item also be highlighted.

please help me on this regard.

Thanks

davidezordan
davidezo...

Contributor

Contributor

5682 points

871 Posts

Silverlight MVP

Re: highlighted selected items in listbox

Hi,

read this article: http://weblogs.asp.net/hpreishuber/archive/2008/11/07/silverlight-multiselect-listbox.aspx

Thanks, Davide

Silverlight MVP

Blog Twitter Silverlight Experts

rohitnegi09
rohitnegi09

Member

Member

2 points

63 Posts

Re: Re: highlighted selected items in listbox

Thanks for ur reply.

but i seen this it before but it is basically based on check box but i am not using check box in listbox.

 

please reply.

Thanks

meykih
meykih

Participant

Participant

876 points

210 Posts

Re: Re: highlighted selected items in listbox

Hey rohitnegi09,

the point is that in general a listbox (standardly with listboxitems) doesn't allow multiple selection. That's why in the example there is used a group of checkboxes. They are (as far as I know) the only control with a multiple selection possible. If you want them to look like normal listboxitems you can change their style so that the square disappears. I did something similar with radiobuttons...

Regards,
Maike Ohlig

Please mark post as answer if it helped you

rohitnegi09
rohitnegi09

Member

Member

2 points

63 Posts

Re: Re: highlighted selected items in listbox

 Thanks For ur reply..ihave no conserned about multiple selection.i want that if i select any item that background should be change and when we select another one than last one background should not be changed.

so please help me on this regard.

Regards

meykih
meykih

Participant

Participant

876 points

210 Posts

Re: Re: highlighted selected items in listbox

But that exactly is the typical behaviour for multiple selection. Select one item and then another one and keep the first one selected. Then the first one will also keep the defined style for selected items...

Regards,
Maike Ohlig

Please mark post as answer if it helped you

rohitnegi09
rohitnegi09

Member

Member

2 points

63 Posts

Re: Re: Re: highlighted selected items in listbox

 Thanks Maike for ur reply

Can You share some piece of code in which you are using radiobutton for multiple selection?

Regards

meykih
meykih

Participant

Participant

876 points

210 Posts

Re: Re: Re: highlighted selected items in listbox

Think you got me wrong. I didn't use radiobuttons for multiple selection (cause that won't make sense) but I created a style for radiobuttons so they looked like simple textitems.

Regards,
Maike Ohlig

Please mark post as answer if it helped you

lee_sl
lee_sl

Contributor

Contributor

2990 points

584 Posts

Answered Question

Re: Re: Re: highlighted selected items in listbox

Here is a sample implementation

http://leeontech.wordpress.com/2009/01/07/multiple-selection-listbox/

----------------------------------------------
Available for consulting in Dallas, TX
http://leeontech.wordpress.com/
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities