Hi,
I'm working on an application that maps a Legacy DB. Many tables have compund keys.
The ListViews of objects with compound key doesn't show SelectionColumns, instead the listview shows the Delete Button.
How can I force the selection box to appear?
Attached is a screenshot of the listview.
Thanks,
Analia
Here is the sample code:
public struct SectorDepositoKey
{
[NoForeignKey]
[Persistent("STTDEI_DEPOSI")]
[Size(15)]
public Deposito Deposito { get; set; }
[Persistent("STTDEI_SECTOR")]
[Size(15)]
public string Sector { get; set; }
public SectorDepositoKey(Deposito _Deposito, string _CodSector)
: this()
{
Deposito = _Deposito;
Sector = _CodSector;
}
}
[DefaultClassOptions]
[OptimisticLocking(false)]
[DefaultProperty("Codigo")]
[Persistent("STTDEI")]
// Specify more UI options using a declarative approach (http://documentation.devexpress.com/#Xaf/CustomDocument2701).
public class SectorDeposito : XPBaseObject
{ // Inherit from a different class to provide a custom primary key, concurrency and deletion behavior, etc. (http://documentation.devexpress.com/#Xaf/CustomDocument3146).
public SectorDeposito(Session session)
: base(session)
{
}
[Key, Persistent, Browsable(false), VisibleInDetailView(false), VisibleInListView(false), VisibleInLookupListView(false)]
public SectorDepositoKey Key { get; set; }
[PersistentAlias("Key.Deposito")]
public Deposito Deposito
{
get { return (Deposito)(EvaluateAlias("Deposito")); }
set { Key = new SectorDepositoKey(value, Codigo); } // If you need to edit the key parts.
}
[PersistentAlias("Key.Sector")]
public string Codigo
{
get { return Convert.ToString(EvaluateAlias("Codigo")); }
set { Key = new SectorDepositoKey(Deposito, value); } // If you need to edit the key parts.
}
private string _Descripcion;
[VisibleInLookupListView(true)]
[Size(60), Persistent("STTDEI_DESCRP")]
public string Descripcion
{
get
{
return _Descripcion;
}
set
{
SetPropertyValue("Descripcion", ref _Descripcion, value);
}
}
}
}
[DefaultClassOptions]
[OptimisticLocking(false)]
[DefaultProperty("Codigo")]
[Persistent("STTDEH")]
// Specify more UI options using a declarative approach (http://documentation.devexpress.com/#Xaf/CustomDocument2701).
public class Deposito : XPBaseObject
{ // Inherit from a different class to provide a custom primary key, concurrency and deletion behavior, etc. (http://documentation.devexpress.com/#Xaf/CustomDocument3146).
public Deposito(Session session)
: base(session)
{
}
private string _Codigo;
[Key, Size(15), Persistent("STTDEH_DEPOSI"), VisibleInListView(true)]
public string Codigo
{
get
{
return _Codigo;
}
set
{
SetPropertyValue("Codigo", ref _Codigo, value);
}
}
private string _Descripcion;
[VisibleInLookupListView(true)]
[Size(60), Persistent("STTDEH_DESCRP")]
public string Descripcion
{
get
{
return _Descripcion;
}
set
{
SetPropertyValue("Descripcion", ref _Descripcion, value);
}
}
}