1

I am using the Microsoft.Phone.Controls.Toolkit in my Windows Phone 8 project. There is this control named list picker which is the substitute for the conventional dropdownlist control in windows phone. When the number of items in the list is more than 5 the list picker automatically opens into a full screen page which is quite useful as a built in functionality. The problem I have here is that in full screen mode the selected item never gets highlighted as in the case of normal expanded mode. Is there any solution to this other than restricting the listpicker from going to full screen mode(I've already tried that but it is not at all advisable for long lists like list of countries,states etc.)?

Anzal M S
  • 89
  • 1
  • 7

1 Answers1

0

You can also create two template:one for selected item and other for rest of them. If current item is selected than you can assign template accordingly.

You can assign your template here:

<toolkit:ListPicker 
    x:Name="ddlMode" 
    FullModeItemTemplate="Give your templete selector">
</toolkit:ListPicker>
L-Ray
  • 1,637
  • 1
  • 16
  • 29
Pratik Goyal
  • 294
  • 1
  • 9
  • Hi @Pratik, Can you please show me how to do this? I have tried to set the FullModeItemTemplate which does not allow me to write visual states since it is just a datatemplate. – Anzal M S Jan 13 '14 at 12:00
  • FullModeItemTemplate will help me bind the property to be listed right? same way as displaymember path. I am unable to handle the selected visual state using full mode item template. – Anzal M S Jan 13 '14 at 14:01
  • Hi @L-Ray,Any idea how to add a selected visual state to full mode item template?Is it even possible? – Anzal M S Jan 16 '14 at 04:58
  • Yes, FullModeItemTemplate will be for data template and if we create two template one for default row and one for selected row and using some validation you can check whether the current element is selected one or not. – Pratik Goyal Jan 16 '14 at 10:14
  • How exactly do I create two different templates for default Item and Selected Item @pratik-goyal?I could not find it anywhere. – Anzal M S Jan 16 '14 at 11:17
  • I also come up with a simple solution Step1: class abc {string text; bool isSelected;} Step2: if current item is selected you can set this flag variable to true. Step3: now return the background from DataContext on the basis of "isSelected" flag. – Pratik Goyal Jan 16 '14 at 11:43