私は devexpressgridcontrol を持っています。グリッドの 1 つの列で使用したい: repositoryLookUpEdit. repositoryLookUpEdit にデータベースの質問を入力します。この質問は、 IdPerson 、 Name 、および IdCity の 3 つの列を返します。列: IdPerson と Name にはデータがありますが、IdCity はアプリケーションで設定する必要があります。
したがって、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;