为了账号安全,请及时绑定邮箱和手机立即绑定

JSON到Devexpress Winforms LookUpEdit控件

JSON到Devexpress Winforms LookUpEdit控件

C#
犯罪嫌疑人X 2021-04-09 17:19:13
我的JSON文件内容如下:{  01: "One",  02: "Two",  03: "Three",  04: "Four",  05: "Five",  06: "Six",  07: "Seven",  08: "Eight",  09: "Nine",  10: "Ten"}我正在使用Newtonsoft.Json图书馆。我这样尝试过:    var json = File.ReadAllText(@"numbers.json");    var array = JObject.Parse(json);    lookUpEdit1.Properties.DropDownRows = array.Count > 10 ? 10 : array.Count;    lookUpEdit1.Properties.DisplayMember = "Key";    lookUpEdit1.Properties.ValueMember = "Value";    lookUpEdit1.Properties.DataSource = array.ToList();    lookUpEdit1.Properties.Columns.Add(new LookUpColumnInfo("Key"));它给出了这样的错误: 'JObject' does not contain a definition for 'ToList' and no extension method 'ToList' accepting a first argument of type 'JObject' could be found (are you missing a using directive or an assembly reference?)如何从JSON文件填写Devexpress Winforms LookUpEdit?
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 166 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信