如何将数据库中的列表绑定到 RibbonComboBox 中?
我有从数据库返回字符串列表的函数。我想在 wpf 功能区菜单中显示这些结果。
我认为我需要将 RibbonComboBox
与 RibbonGalleryCategory
一起使用,并以某种方式绑定 RibbonGalleryItem
来显示数据库的结果。
我的数据库函数的代码如下所示:
public List<String> GetSeanceListName()
{
List<String> seanceList = new List<String>();
seanceList = (from s in Db.Seance
where s.Date >= DateTime.Today
select s.Name).ToList();
return seanceList;
}
非常感谢这里的任何帮助!
I have function that return list of strings from database. I want to show those results in wpf ribbon menu.
I think that I need to use RibbonComboBox
with RibbonGalleryCategory
and bind RibbonGalleryItem
somehow to show resulats from db.
Code of my db function looks like that:
public List<String> GetSeanceListName()
{
List<String> seanceList = new List<String>();
seanceList = (from s in Db.Seance
where s.Date >= DateTime.Today
select s.Name).ToList();
return seanceList;
}
Any help here much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该适用于您的情况:
This should work in your case: