R
Ricardo Luceac
Hi all...
I have the following code:
protected override void OnLoad(EventArgs e)
{
_presenter.OnViewReady();
base.OnLoad(e);
lProfs=_presenter.getProfs();
cbbProf.DataSource = lProfs;
cbbProf.ValueMember = "cpf";
cbbProf.DisplayMember="nome";
}
So when the view loads it populates my combobox.
Then when I select a order id and click load, executes the following
method:
private void btnCarrega_Click(object sender, EventArgs e)
{
int ped = Convert.ToInt32(txtPedido.Text);
if (_presenter.existePedido(ped))
{
lnew = _presenter.getLaudo(ped);
btnGrava.Enabled = true;
cbbProf.Enabled = true;
rtbLaudo.Enabled = true;
rtbLaudo.Rtf= lnew.Texto;
cbbProf.SelectedValue = lnew.CodProfissional;
}
else
{
MessageBox.Show("Pedido não cadastrado"}
}
but when it executes the line :
cbbProf.SelectedValue = lnew.CodProfissional;
the selectedvalue is set to null.
My lnew.CodProfissional isn't null, it always have integer values.
Why is this happenning??
I have the following code:
protected override void OnLoad(EventArgs e)
{
_presenter.OnViewReady();
base.OnLoad(e);
lProfs=_presenter.getProfs();
cbbProf.DataSource = lProfs;
cbbProf.ValueMember = "cpf";
cbbProf.DisplayMember="nome";
}
So when the view loads it populates my combobox.
Then when I select a order id and click load, executes the following
method:
private void btnCarrega_Click(object sender, EventArgs e)
{
int ped = Convert.ToInt32(txtPedido.Text);
if (_presenter.existePedido(ped))
{
lnew = _presenter.getLaudo(ped);
btnGrava.Enabled = true;
cbbProf.Enabled = true;
rtbLaudo.Enabled = true;
rtbLaudo.Rtf= lnew.Texto;
cbbProf.SelectedValue = lnew.CodProfissional;
}
else
{
MessageBox.Show("Pedido não cadastrado"}
}
but when it executes the line :
cbbProf.SelectedValue = lnew.CodProfissional;
the selectedvalue is set to null.
My lnew.CodProfissional isn't null, it always have integer values.
Why is this happenning??