开发者

WPF Binding: Waiting for ItemsSource

I have a problem with the following binding:

<telerik:RadComboBox ItemsSource="{Binding Source={StaticResource TemplateDataSource}, Path=Templates}"
                     SelectedValue="{Binding Template}"
                     SelectedValuePath="Id"
                     DisplayMemberPath="Title"
                     Margin="0">
</telerik:RadComboBox>

All my data is loaded async via WCF data services.

From time to time I get the following error (which I could trace back to the above binding)

Specified argument was out of the range of valid values.
Parameter name: index

Now I guess it has something to do with the entity providing the SelectedValue (Template) be开发者_运维问答ing loaded before the ItemsSource. Could this be? Is there a solution to this problem, like waiting for the ItemsSource to load?

Thanks for any help in advance!


Try to write Dummy converter on SelectedValue="{Binding Template}" You can then debug this converter to find out real cause of error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜