This is a migrated thread and some comments may be shown as answers.

Highlight an item of DataBoundListBox?

4 Answers 65 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kai
Top achievements
Rank 2
Kai asked on 01 Jul 2013, 05:19 PM
Hi all,
I have a databoundlistbox with 30 records containing creationdates. I use BringIntoView to ensure that the upcoming item is always display initially. But is it also possible to highlight the upcoming item? E.g. by drawing a border around the item, or using a different background (color or image) etc.?
Many thanks!

4 Answers, 1 is accepted

Sort by
0
Kai
Top achievements
Rank 2
answered on 01 Jul 2013, 06:25 PM
OK, It worked fine with setting .selectedItem, I just had by default Style="{StaticResource PhoneTextSubtleStyle}" set which prevents displaying the selection marks .... :-\ Anyway, is it possible to define the style of the selected item, like drawing a border around the selected item?
0
Deyan
Telerik team
answered on 02 Jul 2013, 06:53 AM
Hello Kai,

Thanks for writing and for your question.

It is possible to change the Selected state to draw a border around the item. You can do that by extracting the default item style and modifying its visual states according to your requirements.

You can extract the style either in VS 2012 or in Expression Blend by selecting the DataBoundListBox, right-clicking on it and editing the default style for the item.

Hope this helps.

Regards,
Deyan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Kai
Top achievements
Rank 2
answered on 20 Jul 2013, 06:14 PM
Hi Deyan,
now I have the following problem: On application start, I could select an item via backend. That works fine. Now the user clicks on another icon and a details page opens. When the user goes back to main page, the clicked item is the selected item. But i also want to highlight the item which I've selected in the backend on the application start. How could I do that? Best would be 2 different marks, one for the item selected in the backend and one for the item selected from the user.
Thanks!
0
Deyan
Telerik team
answered on 22 Jul 2013, 01:26 PM
Hi Kai,

Thanks for writing.

You can implement a property which marks whether an item has already been selected on your View Model and set it to true each time an item is selected. You can use this property to change the appearance of a given element in your Data Template thus achieving the behavior of having certain visual change when an item has already been selected.

I hope this helps.

Regards,
Deyan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
DataBoundListBox
Asked by
Kai
Top achievements
Rank 2
Answers by
Kai
Top achievements
Rank 2
Deyan
Telerik team
Share this question
or