Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Collection Editor for enum -C#

$
0
0

I have a userControl to store filters of Destino. My code is below:

//In UserControl

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public List<Destino> DestinosFiltro { get; set; }


//enum
public enum Destino
{
   [Description("Receita")]
   Receita = 0,
   [Description("Despesa")]
   Despesa = 1,
   [Description("Ativo")]
   Ativo = 2,
   [Description("Passivo")]
   Passivo = 3,
   [Description("Transitório")]
   Transitório = 4
}

Then the property DestinosFiltro appears in the Properties Page in Design mode. And when I am trying to edit this property in design time, a collection editor appears and work fine. But when I close the collection editor, the value entered is cleared. The value of the property DestinosFiltro is losted. Where is my mistake?  

Thank for all.


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>