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

ListBox with Header and data

8 Answers 81 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.
Tomasz
Top achievements
Rank 1
Tomasz asked on 13 Aug 2013, 01:11 PM
Hi,

I would like to put in my app a DataBoundListBox which would have a header and subitems. The data which it should be powerby by in my db looks like this:
To (nvarchar), From (nvarchar), Date (datetime)
I want to have a query which takes the data from the table and select top 3 people from the "From" column and sorts it by month. So in result the ListBox sould look something like this:

July
Person2
Person1
Person3

August
Person1
Person3
Person2

and so on.

Any suggestion on how aproach this?

8 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 14 Aug 2013, 08:22 AM
Hello Tomasz,

Thanks for writing.

I think the best control for your scenario is RadJumpList:

http://www.telerik.com/products/windows-phone/overview/all-controls/jumplist.aspx

It supports grouping, i.e. displaying items in groups with specific group headers and sub items.

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 >>
0
Tomasz
Top achievements
Rank 1
answered on 19 Aug 2013, 01:54 PM
Hi,

great, thanks!
On more additional question about styling the header? I have a DateTime property but on my UI i just want to show the year and month so the headers would be like:
2013-07
2013-08

I've tried doing styling like this:
<telerikData:RadJumpList.GroupHeaderTemplate>
    <DataTemplate>
        <Border
            Background="#CC000000">
            <TextBlock
                FontSize="36"
                Text="{Binding StringFormat='yyyy-MM'}"/>
        </Border>
    </DataTemplate>
</telerikData:RadJumpList.GroupHeaderTemplate>

but it doesn't really work :/

any suggestions?
0
Deyan
Telerik team
answered on 20 Aug 2013, 07:44 AM
Hi Tomasz,

Thanks for writing.

Could you please share some further information on what exactly happens when you implement that template?

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
Tomasz
Top achievements
Rank 1
answered on 20 Aug 2013, 07:53 AM
Still the header displays such text:
2013-08-20 02:00:00
where it should just show:
2013-08
0
Deyan
Telerik team
answered on 20 Aug 2013, 08:31 AM
Hi Tomasz,

Thanks for writing back.

I think the way you are using the StringFormat property is not entirely correct. Take a look at this article on MSDN:

http://msdn.microsoft.com/en-us/library/system.windows.data.bindingbase.stringformat.aspx

Does it work as expected when you apply a format like {0:yyyy-MM}?

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
Tomasz
Top achievements
Rank 1
answered on 20 Aug 2013, 09:26 AM
Doesn't work at all...
0
Tomasz
Top achievements
Rank 1
answered on 20 Aug 2013, 10:08 AM
Ok, after some testing I just wrote a standard converter in C# that does the job
0
Deyan
Telerik team
answered on 20 Aug 2013, 10:33 AM
Hi Tomasz,

Yes, using a Converter is what I was going to suggest you if the StringFormat approach didn't work.

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
Tomasz
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Tomasz
Top achievements
Rank 1
Share this question
or