I am creating a customized grid in windows phone. I had done with all, but I am unsuccessful in changing the grid selected row background color. I had tried the rowbackground property and also changed rowbackground color in grid selection_changed event. But nothing helped. Grid is displaying some default color when the row is selected. I searched some forums and found xaml code but no use. Anybody help me with xaml code else programmatically?
1 Answers
Create a new Style / template using blend which specifies the desired colours for the selected visual state. to do this, you are best off using Expression Blend. You should already have it installed as it comes as part of the wp7 sdk or toolkit.
In the objects and timeline select your grid. If you can't see it add a temporary one somewhere and use that and remove it at the end.
With a grid selected, right click it and select Edit Template\Edit a Copy
Decide whether you want this to be local or reused and select appropriately.
This will then give you a copy ofthe styling that is used for this control. Find the section VisualStateGroup - and somewhere in there you should find the Selected visual state. Style this accordingly to what you are after.
Make sure you give this Style/template a suitable name and ensure your original grid points to this style, and it should then pick up the new selected row colour.