原創(chuàng)|其它|編輯:郝浩|2012-05-21 01:22:32.000|閱讀 432 次
概述:如何才能顯示DevExpress DetailView對象中的所有細(xì)節(jié),而不是只顯示默認(rèn)屬性值(DefaultProperty)的組合框?
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
問題描述:
如何才能顯示DevExpress DetailView對象中的所有細(xì)節(jié),而不是只顯示默認(rèn)屬性值(DefaultProperty)的組合框?
附錄里是此問題的詳細(xì)描述。
下面是部分類:
[DefaultClassOptions]
public class CTe : BaseObject
{
.....
private Emitente emitente;
public Emitente Emitente
{
get { return this.emitente; }
set { SetPropertyValue("Emitente", ref emitente, value); }
}
我需要顯示所有Emitente細(xì)節(jié),而不是只顯示組合框中的默認(rèn)屬性值。我該怎么辦呢?
問題解答:
有兩種方法可以解決以上問題:
1、使用 特征裝飾Emitente屬性。
2、為此屬性分配。你可以通過模型編輯器或者裝飾屬性EditorAlias(DevExpress.ExpressApp.Editors.EditorAliases.DetailPropertyEditor)的特征來完成此操作。
附錄:
這是Emitente類,CTe對象的屬性。
這是CTe對象:
我們需要顯示所有Emitente數(shù)據(jù)而不單是Nome Fantasia屬性。怎樣才能實(shí)現(xiàn)呢?下面是視圖模型詳情。
下面是Emitente類:
[DefaultProperty("NomeFantasia")]
public class Emitente : Entidade
{
public Emitente(Session session) : base(session) { }
public override void AfterConstruction()
{
base.AfterConstruction();
// Place here your initialization code.
}
}
}
下面是entidade類:
[DefaultClassOptions]
public class Entidade : BaseObject
{
public Entidade(Session session)
: base(session)
{
}
public override void AfterConstruction()
{
base.AfterConstruction();
// Place here your initialization code.
}
private String cpf;
public string Cpf
{
get { return this.cpf; }
set { SetPropertyValue("Cpf", ref cpf, value); }
}
private String cnpj;
public string Cnpj
{
get { return this.cnpj; }
set { SetPropertyValue("Cnpj", ref cnpj, value); }
}
private String inscricaoEstadual;
public string InscricaoEstadual
{
get { return this.inscricaoEstadual; }
set { SetPropertyValue("InscricaoEstadual", ref inscricaoEstadual, value); }
}
private String razao;
public string Razao
{
get { return this.razao; }
set { SetPropertyValue("Razao", ref razao, value); }
}
private String nomeFantasia;
public string NomeFantasia
{
get { return this.nomeFantasia; }
set { SetPropertyValue("NomeFantasia", ref nomeFantasia, value); }
}
private String logradouro;
public string Logradouro
{
get { return this.logradouro; }
set { SetPropertyValue("Logradouro", ref logradouro, value); }
}
private int numero;
public int Numero
{
get { return this.numero; }
set { SetPropertyValue("Numero", ref numero, value); }
}
private String complemento;
public string Complemento
{
get { return this.complemento; }
set { SetPropertyValue("Complemento", ref complemento, value); }
}
private String bairro;
public string Bairro
{
get { return this.bairro; }
set { SetPropertyValue("Bairro", ref bairro, value); }
}
private String cep;
public string Cep
{
get { return this.cep; }
set { SetPropertyValue("Cep", ref cep, value); }
}
private String pais;
public string Pais
{
get { return this.pais; }
set { SetPropertyValue("Pais", ref pais, value); }
}
private Ufs uf;
public Ufs Uf
{
get { return this.uf; }
set { SetPropertyValue("Uf", ref uf, value); }
}
private String municipio;
public string Municipio
{
get { return this.municipio; }
set { SetPropertyValue("Municipio", ref municipio, value); }
}
private String telefone;
public string Telefone
{
get { return this.telefone; }
set { SetPropertyValue("Telefone", ref telefone, value); }
}
}
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: