Doubt to Load Combobox from an account with the sub account

Asked

Viewed 68 times

0

I made a select to fetch an account and upload the sub account and would like your opinion to see if this is how you do it

code

    private void cbbConta_SelectedIndexChanged(object sender, EventArgs e)
    {

        PlanoContasDTO objPlanoConta = new PlanoContasDTO();

        objPlanoConta.DescricaoPlanoContas = cbbConta.Text;

        objPlanoConta = new PlanoContasModel().PesqContaNome(objPlanoConta);

        int conta = objPlanoConta.CodConta;

        CarregarSubContaCombo(conta);
    }

follow the screenshots of the screen

Choose the consumer account

inserir a descrição da imagem aqui

Choosing the Account sub-account

inserir a descrição da imagem aqui

so far this account is right R=Revenue and does not appear in expenses

inserir a descrição da imagem aqui

  • unfortunately it was not clear your question, maybe if you had the image would be better, but I believe the error is in the index that you are passing as parameter: cbbConta.Selectedindex + 1; usually you do not need to add another one

  • put the images

1 answer

1


Denilson Carlos, try to take the increment of cbbConta.Selectedindex +1.

  private void cbbConta_SelectedIndexChanged(object sender, EventArgs e)
{ 
    codContaSelec = cbbConta.SelectedIndex ;
   // codContaSelec = Convert.ToInt32(conta);
    CarregarSubContaCombo(codContaSelec);
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.