ultrawebgrid下拉栏问题
您好,我已将下拉列表添加到 Ultra Web 网格列,并将下拉列表中选择的值保存到数据库中 当我尝试检索数据并显示数据时,它显示下拉列表的值而不是文本,例如 4001 - 销售,它显示 4001 而不是销售,我想在下拉列表中显示销售文本 如何实现这一目标
hi i have added the drop down list to the ultra web grid column and saved the value selected in the drop down to the database
and when i try to retrieve the data and display the data its showing the value of the dropdown not the text e.g. 4001 - sales it is showing 4001 not sales i want to show the sales text in the drop down
how to achieve this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了类似的问题,我有一个网格,当我单击“添加”按钮添加新行时,现有行将在下拉列表中显示 ID,而不是显示文本。 解决这个问题的方法是将下拉列上的 DataType 设置为 ID 的类型(在我的例子中为 System.Int32)。 希望有帮助。
I had a similar problem where I had a grid and when I clicked an "Add" button to add a new row, the existing rows would show the ID in the drop downs instead of the Display Text. What fixed it was to set the DataType on the drop down column to the type of the ID (in my case, System.Int32). Hope that helps.
此代码对我有用:
ultraGridValueList.ValueListItems.Add("ValueMemeber1", "DisplayMemeber1");
ultraGridValueList.ValueListItems.Add("ValueMemeber2", "DisplayMemeber2");
ultraGridValueList.ValueListItems.Add("ValueMemeber3", "DisplayMemeber3");
ultraGridValueList.ValueListItems.Add("ValueMemeber4", "DisplayMemeber4");
ultraGrid1.DisplayLayout.Bands[0].Columns["myDropDownCol"].ValueList = ultraGridValueList;
This code works for me:
ultraGridValueList.ValueListItems.Add("ValueMemeber1", "DisplayMemeber1");
ultraGridValueList.ValueListItems.Add("ValueMemeber2", "DisplayMemeber2");
ultraGridValueList.ValueListItems.Add("ValueMemeber3", "DisplayMemeber3");
ultraGridValueList.ValueListItems.Add("ValueMemeber4", "DisplayMemeber4");
ultraGrid1.DisplayLayout.Bands[0].Columns["myDropDownCol"].ValueList = ultraGridValueList;