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

Binding in ItemHeaderTemplates

3 Answers 71 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.
Adam12
Top achievements
Rank 1
Adam12 asked on 20 Jul 2011, 02:26 PM
It appears as though the ItemHeader items don't get their DataContext properties set.  Consequently it doesn't appear to be possible to bind to the ViewModel from within an ItemHeaderTemplate.

Is this right? Is there any way to work around it?

Thanks

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 21 Jul 2011, 03:43 PM
Hello Adam,

I am not quite sure that I correctly understand the case. Are you setting the ListHeaderTemplate and ListHeader properties and not getting the desired behavior? In fact, we do not have a ItemHeaderTemplate property in RadDataBoundListBox.

Looking forward to receiving further details on your scenario.

Kind regards,
Deyan
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Adam12
Top achievements
Rank 1
answered on 21 Jul 2011, 04:06 PM
Sorry I meant ListHeaderTemplate.  Also I didn't realize you had to set ItemHeaderContent explicitly.  I assumed that it would just pick up the DataContext from the listbox.

Binding the ItemHeaderContent works a treat, thanks.
0
Deyan
Telerik team
answered on 22 Jul 2011, 04:37 PM
Hi Adam12,

Thanks for writing back.

Indeed, you will have to set the DataContext or the ItemHeaderContent explicitly since visual containers are reused in RadDataBoundListBox and thus their DataContext is reset according to the business object behing the corresponding visual container. This is part of our UI virtualization mechanism.

I am happy that you have managed to resolve the case. We will consider the thread closed.

Do not hesitate to get back to us in case you have further questions or need assistance.

Greetings,
Deyan
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
DataBoundListBox
Asked by
Adam12
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Adam12
Top achievements
Rank 1
Share this question
or