开发者

WPF Binding: Waiting for ItemsSource

开发者 https://www.devze.com 2023-03-28 09:15 出处:网络
I have a problem with the following binding: <telerik:RadComboBox ItemsSource=\"{Binding Source={StaticResource TemplateDataSource}, Path=Templates}\"

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

精彩评论

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