user3102858
user3102858

Reputation: 128

make horizontal scrollable custom calendar

I want to make calendar in windows phone 8 using XAML/c#. It should like horizontal bar that has 7 days fit to screen. User can scroll these dates like on phone screen there are 1 to 7 dates and user can scroll to view more dates. If user tap on any date then its color should be changed. I was trying to implement longlistselector and listbox but could do successfully. I am newbie. please help.

Thanks

Upvotes: 0

Views: 410

Answers (1)

Gaurav Deochakke
Gaurav Deochakke

Reputation: 2283

ongListSelector doesn't allows you to change scroll orientation. In other controls like the ListBox you can specify the property ItemsPanel to use a StackPanel with horizontal orientation. But that property is not available in LongListSelector (i don't know exactly the reason, but i think it might be something related with the complex grouping, jump list capabilities of the LongListSelector.

If you need to make an horizontal list and you don't need to group your data, you can replace the LongListSelector with a ListBox and use the ItemsPanel property to specify a horizontal stackpanel.

So, no issues. You can of course use the ListBox instead of LongListSelector. You can have it horizontally scrollable as follows:

<ListBox ScrollViewer.HorizontalScrollBarVisibility="Auto">
<ListBox.ItemsPanel>
    <ItemsPanelTemplate>
        <StackPanel Orientation="Horizontal" />
    </ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
    <DataTemplate>
       <Your control... />
    </DataTemplate>
</ListBox.ItemTemplate>

Upvotes: 1

Related Questions