Jun 12, 2012, 5:14 PM
[CLOSED] How to Call an event by Direct Events
Hi,
I'd like to call a direct event after leave some field. I'm doing this using the "Change OnEvent" but it is called by each caracter entered by the user and I want to call only when the field lost the focus.
Please help me to change to correct method.
My code:
Oliver
I'd like to call a direct event after leave some field. I'm doing this using the "Change OnEvent" but it is called by each caracter entered by the user and I want to call only when the field lost the focus.
Please help me to change to correct method.
My code:
<ext:TextField ID="txtUsername" runat="server" ReadOnly="false" FieldLabel="User"
AllowBlank="false" Text="" LabelAlign="Right">
<DirectEvents>
<Change OnEvent="posicionarEmpresa" />
</DirectEvents>
</ext:TextField>
Code in CS: public void posicionarEmpresa(object sender, DirectEventArgs e)
{
var lista = from f in dc.Empresas
join x in dc.UsuarioEmpresas on f.nCdEmpresa equals x.nCdEmpresa
join u in dc.Usuarios on x.nCdUsuario equals u.nCdUsuario
where u.cNmLogin == this.txtUsername.Text
orderby f.cNmEmpresa
select new
{
f.nCdEmpresa,
f.cNmEmpresa
};
this.StoreEmpresa.DataSource = lista;
this.StoreEmpresa.DataBind();
}
Thanks in advance,Oliver
Last edited by geoffrey.mcgill; Jun 12, 2012 at 6:34 PM.
Reason: [CLOSED]