This is a migrated thread and some comments may be shown as answers.

Problem with bind Transient Attribute. Disappears after few seconds

3 Answers 62 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nelson
Top achievements
Rank 1
Nelson asked on 10 Oct 2011, 05:39 PM
Hi telerik team,

In my application I used an transient attribute in one class of my model. After that, I use this transient attribute to bind a field of an RadGridView.

I saw a strange behavior in this transient attribute bind. When I execute the application, the information of the transient attribute appears but after few seconds disappears.

I will post here my model class with transient attributes.

namespace SGA.Web    
{
    [Table("PARTICIPANTES_REUNIAO")]
    [KeyGenerator(KeyGenerator.Autoinc)]
    public partial class ParticipantesReuniao
    {
        [Telerik.OpenAccess.Transient()]
        private bool _seleccionado;

        [Telerik.OpenAccess.Transient()]
        private string _cor;

        [Telerik.OpenAccess.Transient()]
        private char _valorVoto;

        private long _Id;
        [Column("ID", OpenAccessType = OpenAccessType.Decimal, IsBackendCalculated = true, IsPrimaryKey = true, Length = 22, SqlType = "NUMBER")]
        [Storage("_Id")]
        public virtual long IdProp
        {
            get
            {
                return this._Id;
            }
            set
            {
                this._Id = value;
            }
        }
        
        private long _Entidadeid;
        [Column("ENTIDADE_ID", OpenAccessType = OpenAccessType.Decimal, Length = 22, SqlType = "NUMBER")]
        [Storage("_Entidadeid")]
        public virtual long EntidadeIdProp
        {
            get
            {
                return this._Entidadeid;
            }
            set
            {
                this._Entidadeid = value;
            }
        }
        
        private long _Reuniaoid;
        [Column("REUNIAO_ID", OpenAccessType = OpenAccessType.Decimal, Length = 22, SqlType = "NUMBER")]
        [Storage("_Reuniaoid")]
        public virtual long ReuniaoIdProp
        {
            get
            {
                return this._Reuniaoid;
            }
            set
            {
                this._Reuniaoid = value;
            }
        }
        
        private long _Funcaoreuniaoid;
        [Column("FUNCAO_REUNIAO_ID", OpenAccessType = OpenAccessType.Decimal, Length = 22, SqlType = "NUMBER")]
        [Storage("_Funcaoreuniaoid")]
        public virtual long FuncaoReuniaoIdProp
        {
            get
            {
                return this._Funcaoreuniaoid;
            }
            set
            {
                this._Funcaoreuniaoid = value;
            }
        }
        
        private DateTime? _Datanotificacao;
        [Column("DATA_NOTIFICACAO", OpenAccessType = OpenAccessType.Date, IsNullable = true, SqlType = "DATE")]
        [Storage("_Datanotificacao")]
        public virtual DateTime? DataNotificacaoProp
        {
            get
            {
                return this._Datanotificacao;
            }
            set
            {
                this._Datanotificacao = value;
            }
        }
        
        private short? _Confirmourecepcao;
        [Column("CONFIRMOU_RECEPCAO", OpenAccessType = OpenAccessType.Decimal, IsNullable = true, Length = 1, SqlType = "NUMBER")]
        [Storage("_Confirmourecepcao")]
        public virtual short? ConfirmouRecepcaoProp
        {
            get
            {
                return this._Confirmourecepcao;
            }
            set
            {
                this._Confirmourecepcao = value;
            }
        }
        
        private DateTime? _Dataconfirmacaorecepcao;
        [Column("DATA_CONFIRMACAO_RECEPCAO", OpenAccessType = OpenAccessType.Date, IsNullable = true, SqlType = "DATE")]
        [Storage("_Dataconfirmacaorecepcao")]
        public virtual DateTime? DataConfirmacaoRecepcaoProp
        {
            get
            {
                return this._Dataconfirmacaorecepcao;
            }
            set
            {
                this._Dataconfirmacaorecepcao = value;
            }
        }
        
        private short? _Presencaprevista;
        [Column("PRESENCA_PREVISTA", OpenAccessType = OpenAccessType.Decimal, IsNullable = true, Length = 1, SqlType = "NUMBER")]
        [Storage("_Presencaprevista")]
        public virtual short? PresencaPrevistaProp
        {
            get
            {
                return this._Presencaprevista;
            }
            set
            {
                this._Presencaprevista = value;
            }
        }
        
        private short? _Primeirachamada;
        [Column("PRIMEIRA_CHAMADA", OpenAccessType = OpenAccessType.Decimal, IsNullable = true, Length = 1, SqlType = "NUMBER")]
        [Storage("_Primeirachamada")]
        public virtual short? PrimeiraChamadaProp
        {
            get
            {
                return this._Primeirachamada;
            }
            set
            {
                this._Primeirachamada = value;
            }
        }
        
        private short? _Segundachamada;
        [Column("SEGUNDA_CHAMADA", OpenAccessType = OpenAccessType.Decimal, IsNullable = true, Length = 1, SqlType = "NUMBER")]
        [Storage("_Segundachamada")]
        public virtual short? SegundaChamadaProp
        {
            get
            {
                return this._Segundachamada;
            }
            set
            {
                this._Segundachamada = value;
            }
        }
        
        private short? _Terceirachamada;
        [Column("TERCEIRA_CHAMADA", OpenAccessType = OpenAccessType.Decimal, IsNullable = true, Length = 1, SqlType = "NUMBER")]
        [Storage("_Terceirachamada")]
        public virtual short? TerceiraChamadaProp
        {
            get
            {
                return this._Terceirachamada;
            }
            set
            {
                this._Terceirachamada = value;
            }
        }
        
        private short? _Quartachamada;
        [Column("QUARTA_CHAMADA", OpenAccessType = OpenAccessType.Decimal, IsNullable = true, Length = 1, SqlType = "NUMBER")]
        [Storage("_Quartachamada")]
        public virtual short? QuartaChamadaProp
        {
            get
            {
                return this._Quartachamada;
            }
            set
            {
                this._Quartachamada = value;
            }
        }
        
        private string _Justificacaofalta;
        [Column("JUSTIFICACAO_FALTA", OpenAccessType = OpenAccessType.Varchar, IsNullable = true, Length = 2000, SqlType = "NVARCHAR2")]
        [Storage("_Justificacaofalta")]
        public virtual string JustificacaoFaltaProp
        {
            get
            {
                return this._Justificacaofalta;
            }
            set
            {
                this._Justificacaofalta = value;
            }
        }
        
        private decimal? _Valorpagar;
        [Column("VALOR_PAGAR", OpenAccessType = OpenAccessType.Decimal, IsNullable = true, Length = 6, Scale = 2, SqlType = "NUMBER")]
        [Storage("_Valorpagar")]
        public virtual decimal? ValorPagarProp
        {
            get
            {
                return this._Valorpagar;
            }
            set
            {
                this._Valorpagar = value;
            }
        }
        
        private decimal? _Valorpago;
        [Column("VALOR_PAGO", OpenAccessType = OpenAccessType.Decimal, IsNullable = true, Length = 6, Scale = 2, SqlType = "NUMBER")]
        [Storage("_Valorpago")]
        public virtual decimal? ValorPagoProp
        {
            get
            {
                return this._Valorpago;
            }
            set
            {
                this._Valorpago = value;
            }
        }
        
        private DateTime? _Datapagamento;
        [Column("DATA_PAGAMENTO", OpenAccessType = OpenAccessType.Date, IsNullable = true, SqlType = "DATE")]
        [Storage("_Datapagamento")]
        public virtual DateTime? DataPagamentoProp
        {
            get
            {
                return this._Datapagamento;
            }
            set
            {
                this._Datapagamento = value;
            }
        }
        
        private short _Sit;
        [Column("SIT", OpenAccessType = OpenAccessType.Decimal, Length = 1, SqlType = "NUMBER")]
        [Storage("_Sit")]
        public virtual short SitProp
        {
            get
            {
                return this._Sit;
            }
            set
            {
                this._Sit = value;
            }
        }
        
        private string _Insuser;
        [Column("INS_USER", OpenAccessType = OpenAccessType.Varchar, Length = 40, SqlType = "NVARCHAR2")]
        [Storage("_Insuser")]
        public virtual string InsUserProp
        {
            get
            {
                return this._Insuser;
            }
            set
            {
                this._Insuser = value;
            }
        }
        
        private DateTime _Insdata;
        [Column("INS_DATA", OpenAccessType = OpenAccessType.Date, SqlType = "DATE")]
        [Storage("_Insdata")]
        public virtual DateTime InsDataProp
        {
            get
            {
                return this._Insdata;
            }
            set
            {
                this._Insdata = value;
            }
        }
        
        private string _Altuser;
        [Column("ALT_USER", OpenAccessType = OpenAccessType.Varchar, IsNullable = true, Length = 40, SqlType = "NVARCHAR2")]
        [Storage("_Altuser")]
        public virtual string AltUserProp
        {
            get
            {
                return this._Altuser;
            }
            set
            {
                this._Altuser = value;
            }
        }
        
        private DateTime? _Altdata;
        [Column("ALT_DATA", OpenAccessType = OpenAccessType.Date, IsNullable = true, SqlType = "DATE")]
        [Storage("_Altdata")]
        public virtual DateTime? AltDataProp
        {
            get
            {
                return this._Altdata;
            }
            set
            {
                this._Altdata = value;
            }
        }
        
        private short _Versao;
        [Column("VERSAO", OpenAccessType = OpenAccessType.Decimal, Length = 4, SqlType = "NUMBER")]
        [Storage("_Versao")]
        public virtual short VersaoProp
        {
            get
            {
                return this._Versao;
            }
            set
            {
                this._Versao = value;
            }
        }
        
        private Entidades _Entidades;
        [ForeignKeyAssociation(ConstraintName = "PR_E_FK", SharedFields = "EntidadeIdProp", TargetFields = "IdProp")]
        [Storage("_Entidades")]
        public virtual Entidades EntidadesProp
        {
            get
            {
                return this._Entidades;
            }
            set
            {
                this._Entidades = value;
            }
        }
        
        private FuncoesReuniao _Funcoesreuniao;
        [ForeignKeyAssociation(ConstraintName = "PR_FR_FK", SharedFields = "FuncaoReuniaoIdProp", TargetFields = "IdProp")]
        [Storage("_Funcoesreuniao")]
        public virtual FuncoesReuniao FuncoesreuniaoProp
        {
            get
            {
                return this._Funcoesreuniao;
            }
            set
            {
                this._Funcoesreuniao = value;
            }
        }
        
        private Reunioes _Reunioes;
        [ForeignKeyAssociation(ConstraintName = "PR_R_FK", SharedFields = "ReuniaoIdProp", TargetFields = "IdProp")]
        [Storage("_Reunioes")]
        public virtual Reunioes ReunioesProp
        {
            get
            {
                return this._Reunioes;
            }
            set
            {
                this._Reunioes = value;
            }
        }
        
        private IList<NotificacoesParticipantes> _Notificacoesparticipantes = new List<NotificacoesParticipantes>();
        [Collection(InverseProperty = "ParticipantesreuniaoProp")]
        [Storage("_Notificacoesparticipantes")]
        public virtual IList<NotificacoesParticipantes> NotificacoesParticipantes
        {
            get
            {
                return this._Notificacoesparticipantes;
            }
        }
        
        private IList<NotasReuniao> _Notasreuniaos = new List<NotasReuniao>();
        [Collection(InverseProperty = "ParticipantesreuniaoProp")]
        [Storage("_Notasreuniaos")]
        public virtual IList<NotasReuniao> NotasReuniaos
        {
            get
            {
                return this._Notasreuniaos;
            }
        }
        
        private IList<MensagensReuniao> _Mensagensreuniaos = new List<MensagensReuniao>();
        [Collection(InverseProperty = "ParticipantesreuniaoProp")]
        [Storage("_Mensagensreuniaos")]
        public virtual IList<MensagensReuniao> MensagensReuniaos
        {
            get
            {
                return this._Mensagensreuniaos;
            }
        }
        
        private IList<DocumentoVotacoes> _Documentovotacoes = new List<DocumentoVotacoes>();
        [Collection(InverseProperty = "ParticipantesreuniaoProp")]
        [Storage("_Documentovotacoes")]
        public virtual IList<DocumentoVotacoes> DocumentoVotacoes
        {
            get
            {
                return this._Documentovotacoes;
            }
        }

        [FieldAlias("_cor")]
        public string Cor
        {
            get { return _cor; }
            set { _cor = value; }
        }

        [FieldAlias("_seleccionado")]
        public Boolean Seleccionado
        {
            get { return _seleccionado; }
            set { _seleccionado = value; }
        }

        [FieldAlias("_valorVoto")]
        public char ValorVoto
        {
            get { return _valorVoto; }
            set { _valorVoto = value; }
        }
    }
}


And my XAML where I bind with this transient attribute...

<telerik:RadGridView
                        Name="GrdParticipantesVotantes" Background="Transparent"
                        BorderThickness="0" Grid.Row="1" VerticalAlignment="Top"
                        HorizontalAlignment="Left" Width="450" RowHeight="20" MaxHeight="250" Margin="5 -20 0 0 "
                        ItemsSource="{Binding Path=DataContext.ListaParticipantesVotantes,ElementName=LayoutRoot}"
                        AutoGenerateColumns="False" CanUserReorderColumns="False" CanUserResizeColumns="False"
                        SelectionMode="Single"
                        IsReadOnly="True"
                        Cursor="Hand"
                        RowIndicatorVisibility="Collapsed"
                        IsFilteringAllowed="True"
                        ShowGroupPanel="False"
                        ShowColumnFooters="False" ShowInsertRow="False"
                        telerik:RadDragAndDropManager.AllowDrag="True"
                        telerik:RadDragAndDropManager.AllowDrop="True">
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding EntidadesProp.NomeTratamentoProp}" Header="Nome" Width="0.4*"/>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding FuncoesreuniaoProp.DesignacaoProp}" Header="Função" Width="0.2*"/>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding ValorVoto}" Header="Voto" Width="0.2*"/>
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>

Somebody can tell me what happens?

Thanks in advance,

Nelson Silva

3 Answers, 1 is accepted

Sort by
0
Serge
Telerik team
answered on 13 Oct 2011, 01:21 PM
Hello Nelson,

 Would you mind giving us a bit more to work on. It seems like you have mixed approaches from Telerik OpenAccess ORM and OpenAccess Classic. How was this class created, is it generated by OpenAccess, and if so, how did you get the Transient attribute there? Let me clarify, the transient attribute is part of OpenAccess Classic and is not generated by the designer, it is to be used only when using either the Reverse or Forward Mapping wizard. 

When using the designer, you only specify fields that are non transient in the diagram and they get generated (in the files related to the designer). If you want to specify extra properties (that are not handled by OpenAccess) you can do so in a partial class that extends this class. 

The only thing that the transient attribute does is specify that this property/field should not be handled (persisted) by OpenAccess.

If it is not a problem, please send us a sample project that we can use to reproduce this behaviour, this would be the fastest way to resolve this issue.

I hope this is helpful. 

All the best,
Serge
the Telerik team

Check out the latest stable build of Telerik OpenAccess ORM. Download it and benefit from our new Project Templates.

0
Nelson
Top achievements
Rank 1
answered on 01 Nov 2011, 12:27 AM
Hi there,

Yes,  I already try extend the class but, this property is not visible in my ParticipantesReuniao object.

This is the class that I created:

namespace SGA.Classes
{
    public partial class ParticipantesReuniao
    {
        [Telerik.OpenAccess.Transient()]
        private string _participanteQueConfirmou;

        [FieldAlias("_participanteQueConfirmou")]
        public string ParticipanteQueConfirmou
        {
            get { return _participanteQueConfirmou; }
            set { _participanteQueConfirmou = value; }
        }
    }
}
0
Serge
Telerik team
answered on 03 Nov 2011, 07:40 PM
Hi Nelson,

 Still it is quite hard for us to pinpoint the issue you are experiencing, would you mind sharing you project so that we can debug it locally. 

I am looking forward to resolving this matter with you. 

Best wishes,
Serge
the Telerik team

NEW and UPDATED OpenAccess ORM Resources. Check them out!

Tags
Databases and Data Types
Asked by
Nelson
Top achievements
Rank 1
Answers by
Serge
Telerik team
Nelson
Top achievements
Rank 1
Share this question
or