silverlight中comboBox与数据库绑定的问题:

[复制链接]
查看11 | 回复1 | 2011-7-29 17:12:33 | 显示全部楼层 |阅读模式
silverlight中comboBox与数据库绑定的问题:
xuejicontent = new DomainService1();

xuejicontent.Load(xuejicontent.GetGradsQuery());

this.comboBox1.ItemsSource = xuejicontent.Grads;
comboBox1.DisplayMemberPath = "name";

comboBox1.SelectedIndex = 0;
运行时提示:silverlight中comboBox与数据库绑定的问题:


comboBox1.SelectedIndex = 0;有错,要怎样绑定啊?

回复

使用道具 举报

千问 | 2011-7-29 17:12:33 | 显示全部楼层
你的绑定没有错comboBox1.SelectedIndex = 0;有错,可能是你的xuejicontent.Grads没有数据,然后导致SelectedIndex 超出下标出错...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行