Highlight an item of DataBoundListBox?

5 posts, 0 answers
  1. Kai
    Kai avatar
    6 posts
    Member since:
    Dec 2012

    Posted 01 Jul 2013 Link to this post

    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!
  2. Kai
    Kai avatar
    6 posts
    Member since:
    Dec 2012

    Posted 01 Jul 2013 Link to this post

    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?
  3. DevCraft banner
  4. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 02 Jul 2013 Link to this post

    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 >>
  5. Kai
    Kai avatar
    6 posts
    Member since:
    Dec 2012

    Posted 20 Jul 2013 Link to this post

    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!
  6. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 22 Jul 2013 Link to this post

    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 >>
Back to Top
DevCraft banner