Devexpress RepositoryLookUpEdit ingrid,该值消失

时间:2014-12-02 09:55:12

标签: devexpress repositorylookupedit

我有一个devexpressgridcontrol。我想在网格的一列中使用:repositoryLookUpEdit。 我用repository数据库问题填充repositoryLookUpEdit。  此问题返回三列:IdPerson,Name和IdCity。 Colums:IdPerson和Name有数据,但IdCity我必须在appication中设置。

所以 - 在gridcontrol中,Idcity列具有fildename:IdCity和columnEdit:repositoryLookUpEdit。 - repositoryLookUpEdit具有DisplayValue:CityName和ValueMember:IdCity。

我的问题是:

当我在网格中选择一行的城市值并转到另一行时,第一行的值会降低。

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

我使用的是Devexpress 9.2。

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;

1 个答案:

答案 0 :(得分:0)

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

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

相关问题