首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >网格中的Devexpress RespositoryLookUpEdit,值的舍入

网格中的Devexpress RespositoryLookUpEdit,值的舍入
EN

Stack Overflow用户
提问于 2014-12-02 09:55:12
回答 1查看 934关注 0票数 0

我有个高速公路控制系统。我想在网格的一个列中使用: repositoryLookUpEdit。我用数据库问题填充repositoryLookUpEdit。此问题返回三列: IdPerson、Name和IdCity。列: IdPerson和Name都有数据,但IdCity必须在应用程序中设置。

在gridcontrol中,IdCity列有文件名: Idcity和columnEdit : repositoryLookUpEdit。- repositoryLookUpEdit有DisplayValue : CityName,ValueMember: IdCity。

我的问题是:

当我在城市的一行值中选择网格,然后转到另一行时,第一行的值就会消失。

我做错什么了?你能给我一些建议吗?

我用Devexpress 9.2。

代码语言:javascript
复制
this.gvPerson = new DevExpress.XtraGrid.Views.Grid.GridView(); 
this.replueCity = new DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit();
this.replueCity.Columns.AddRange(new DevExpress.XtraEditors.Controls.LookUpColumnInfo[] { new     DevExpress.XtraEditors.Controls.LookUpColumnInfo("IdCity", "IdCity", 20,     DevExpress.Utils.FormatType.None, "", false, DevExpress.Utils.HorzAlignment.Default), new DevExpress.XtraEditors.Controls.LookUpColumnInfo("CityName", "CityName")});
this.replueCity.DisplayMember = "CityName"; 
this.replueCity.Name = "replueCity"; 
this.replueCity.NullText = "[Choose city]"; 
this.replueCity.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard; 
this.replueOceny.ValueMember = "IdCity"; 
// CityColumn this.CityColumn.AppearanceCell.Options.UseTextOptions = true; 
this.CityColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; 
this.CityColumn.AppearanceCell.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center; 
this.CityColumn.Caption = "Ocena"; 
this.CityColumn.ColumnEdit = this.replueCity; 
this.CityColumn.FieldName = "IdCity"; 
this.CityColumn.Name = "IdCityName"; 
this.CityColumn.Visible = true;
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-12-02 12:43:22

您必须为ValueMember (列中的编辑器)设置replueCity。您只为replueOceny设置了它。

在所有三种情况下检查字符串IdCity:它必须写得完全相同(请记住大写!)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27246449

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档