This question is locked. New answers and comments are not allowed.
Binding a collection to ItemSource does not work. Only setting it in code behind works.
When using a template to get the value I can't do something as follows:
Instead, I need to bind it to the Item property:
I believe the first one is the expected behavior in a DataTemplate.
When using a template to get the value I can't do something as follows:
<
loopingList:RadLoopingList.ItemTemplate
>
<
DataTemplate
>
<
TextBox
Text
=
"{Binding}"
/>
</
DataTemplate
>
</
loopingList:RadLoopingList.ItemTemplate
>
Instead, I need to bind it to the Item property:
<
loopingList:RadLoopingList.ItemTemplate
>
<
DataTemplate
>
<
TextBox
Text
=
"{Binding Item}"
/>
</
DataTemplate
>
</
loopingList:RadLoopingList.ItemTemplate
>
I believe the first one is the expected behavior in a DataTemplate.
8 Answers, 1 is accepted
0
Hello,
Thank you for contacting us.
Currently, the DataContext of each LoopingListItem is of type LoopingListDataItem which holds the associated bussines item in its Item property. So far the RadLoopingList control was used for internal purposes(i.e. for building the RadTimePicker and RadDatePicker). Now, when we released the control we did not want to make breaking changes, so this behavior is expected. I will make sure that such example will be included in our online help.
Thank you for your valuable feedback. Please, let me know should you have any other questions or suggestions.
Regards,
Ivaylo Gergov
Telerik
Thank you for contacting us.
Currently, the DataContext of each LoopingListItem is of type LoopingListDataItem which holds the associated bussines item in its Item property. So far the RadLoopingList control was used for internal purposes(i.e. for building the RadTimePicker and RadDatePicker). Now, when we released the control we did not want to make breaking changes, so this behavior is expected. I will make sure that such example will be included in our online help.
Thank you for your valuable feedback. Please, let me know should you have any other questions or suggestions.
Regards,
Ivaylo Gergov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
hosney
Top achievements
Rank 1
answered on 16 Mar 2015, 12:43 PM
What about binding to ItemSource?
0
Hi,
I have attached a sample project which is working on our side. Could you please modify it in order to reproduce the issue?
I am looking forward to your reply.
Regards,
Ivaylo Gergov
Telerik
I have attached a sample project which is working on our side. Could you please modify it in order to reproduce the issue?
I am looking forward to your reply.
Regards,
Ivaylo Gergov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
hosney
Top achievements
Rank 1
answered on 17 Mar 2015, 11:37 AM
Funny.. but it doesn't happen to me anymore. I'm not sure if the latest update I got had anything to do with it.
Anyway I do have another problem where the list does not appear on first load, but appears on subsequent loads. I've modified your example to display this behavior.
I'm trying to create a time span picker here (since this is missing from the control set). Would be great if you could help out with that!
Thanks
Anyway I do have another problem where the list does not appear on first load, but appears on subsequent loads. I've modified your example to display this behavior.
I'm trying to create a time span picker here (since this is missing from the control set). Would be great if you could help out with that!
<
Grid
>
<
Button
Content
=
"click!"
>
<
Button.Flyout
>
<
PickerFlyout
Placement
=
"Full"
ConfirmationButtonsVisible
=
"True"
>
<
Grid
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
loopingList:RadLoopingList
x:Name
=
"HoursList"
ItemsSource
=
"{Binding}"
ItemWidth
=
"140"
ItemHeight
=
"140"
>
<
loopingList:RadLoopingList.ItemTemplate
>
<
DataTemplate
>
<
Border
Width
=
"138"
Height
=
"138"
BorderThickness
=
"2"
BorderBrush
=
"{ThemeResource ButtonDisabledBorderThemeBrush}"
>
<
Grid
Margin
=
"6"
>
<
TextBlock
Text
=
"{Binding Item}"
VerticalAlignment
=
"Center"
/>
<
TextBlock
VerticalAlignment
=
"Bottom"
FontSize
=
"{ThemeResource ContentControlFontSize}"
Text
=
"Hours"
/>
</
Grid
>
</
Border
>
</
DataTemplate
>
</
loopingList:RadLoopingList.ItemTemplate
>
</
loopingList:RadLoopingList
>
<
loopingList:RadLoopingList
Grid.Column
=
"1"
x:Name
=
"MinutesList"
ItemsSource
=
"{Binding}"
ItemWidth
=
"140"
ItemHeight
=
"140"
>
<
loopingList:RadLoopingList.ItemTemplate
>
<
DataTemplate
>
<
Border
Width
=
"138"
Height
=
"138"
BorderThickness
=
"2"
BorderBrush
=
"{ThemeResource PhoneMidBrush}"
>
<
Grid
Margin
=
"6"
>
<
TextBlock
Text
=
"{Binding Item}"
VerticalAlignment
=
"Center"
/>
<
TextBlock
VerticalAlignment
=
"Bottom"
FontSize
=
"{ThemeResource ContentControlFontSize}"
Text
=
"Minutes"
/>
</
Grid
>
</
Border
>
</
DataTemplate
>
</
loopingList:RadLoopingList.ItemTemplate
>
</
loopingList:RadLoopingList
>
</
Grid
>
</
PickerFlyout
>
</
Button.Flyout
>
</
Button
>
</
Grid
>
Thanks
0
Accepted
Hello,
It seems that currently the RadLoopingList does not measure properly when its available size is infinity(in case it is placed in scrollviewer or flyout) because it does not have MinWidth and MinHeight. In this case you can set it yourself and it should be working. Also this fill be fixed for our upcoming Service Pack in April.
Please, let me know if this helps.
Regards,
Ivaylo Gergov
Telerik
It seems that currently the RadLoopingList does not measure properly when its available size is infinity(in case it is placed in scrollviewer or flyout) because it does not have MinWidth and MinHeight. In this case you can set it yourself and it should be working. Also this fill be fixed for our upcoming Service Pack in April.
Please, let me know if this helps.
Regards,
Ivaylo Gergov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
hosney
Top achievements
Rank 1
answered on 20 Mar 2015, 11:06 AM
That's great! Thanks for your help.
0
Damien
Top achievements
Rank 1
answered on 02 Apr 2015, 05:43 PM
I downloaded the sample project earlier in this thread and it doesn't work. I get the error TemplateNotAppliedException. I have re-downloaded the SDK and also tried a repair. This happens when adding the control to my own projects as well as the sample project.
I get the same error/crash in the emulators and a physical Windows Phone 8.1 device.
Any idea what could be wrong?
I get the same error/crash in the emulators and a physical Windows Phone 8.1 device.
Any idea what could be wrong?
0
Hi Damien,
So far we do not have any similar known issues. Could you please try to uninstall our product and install it manually from the msi file instead of our control panel? If this does not help please elaborate more on what visual studio do you use or any additional information that could be useful.
I am looking forward to your reply.
Regards,
Ivaylo Gergov
Telerik
So far we do not have any similar known issues. Could you please try to uninstall our product and install it manually from the msi file instead of our control panel? If this does not help please elaborate more on what visual studio do you use or any additional information that could be useful.
I am looking forward to your reply.
Regards,
Ivaylo Gergov
Telerik
See What's Next in App Development. Register for TelerikNEXT.