我有一個devexpressgridcontrol。我想在網格的一列中使用:repositoryLookUpEdit。 我使用數據庫問題填充repositoryLookUpEdit。 此問題返回三列:IdPerson,Name和IdCity。 Colums:IdPerson和Name有數據,但IdCity我必須在appication中設置。Devexpress RespositoryLookUp在網格中的值,價值便宜
所以 - 在gridcontrol中,Idcity列有fildename:IdCity和columnEdit:repositoryLookUpEdit。 - repositoryLookUpEdit具有DisplayValue:CityName和ValueMember:IdCity。
我的問題是:
當我在城市的一個行值格選擇,我去到另一行,從第一行disaper值。
我在做什麼錯?你能給我一些建議嗎?
我使用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;
在所有三種情況下檢查字符串「IdCity」:它必須寫得完全一樣(請注意帽子!) – 2014-12-02 10:00:09
我會檢查,但它不起作用。 – Jola 2014-12-02 10:48:18
然後粘貼一些代碼... – 2014-12-02 11:04:56