Closed Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: help

  1. #1
    nero29 is offline Newbie
    Join Date
    Mar 2010
    Posts
    12
    Rep Power
    0

    help

    help regarding our project my professor ask us to make a project. i have created a windows application but duno how to implement the code. this is wat i want to do. in the combobox if you select the item then the price should also appear automatically in the text box how am i going to code that?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    abdul.gafur's Avatar
    abdul.gafur is offline Learning Programmer
    Join Date
    Mar 2010
    Location
    Salo, Riau, Indonesia
    Posts
    42
    Rep Power
    0

    Re: help

    This forum is not to do your job, but to help you, try to start create that program, if you have trouble, we will help

  4. #3
    nero29 is offline Newbie
    Join Date
    Mar 2010
    Posts
    12
    Rep Power
    0

    Re: help

    @abdul i have already created a program.

    i want to know how to do it i mean i duno wat to put on the event. cause this is wat i want to do when u choose an item in combobox the price should automatically appear how do i do that?

  5. #4
    nero29 is offline Newbie
    Join Date
    Mar 2010
    Posts
    12
    Rep Power
    0

    Re: help

    help everyone

  6. #5
    nero29 is offline Newbie
    Join Date
    Mar 2010
    Posts
    12
    Rep Power
    0

    Re: help

    guys could someone tell me how do i refresh my combobox and clear it? cause whenever i use combobox1.clear() it doesnt work

  7. #6
    gokuajmes's Avatar
    gokuajmes is offline Programming God
    Join Date
    Jan 2010
    Location
    India
    Posts
    516
    Blog Entries
    5
    Rep Power
    12

    Re: help

    Ok the code goes like this have a neat look

    Code:
     
    //Event handler for Dropdownlist selected index change
    public void myDropDownList_SelectedIndexChange(Object sender,EventArgs e)
    {
     //check if use has selected nothing
     if( myDropDownList.SelectedIndex ! = -1)
    {
     //if the user has selected something then we enter the if, assign the selected value of the drop down into the text box.
      TextBox1.Text = myDropDownList.SelectedValue.ToString() ;
    }
    }

  8. #7
    abdul.gafur's Avatar
    abdul.gafur is offline Learning Programmer
    Join Date
    Mar 2010
    Location
    Salo, Riau, Indonesia
    Posts
    42
    Rep Power
    0

    Re: help

    Quote Originally Posted by nero29 View Post
    guys could someone tell me how do i refresh my combobox and clear it? cause whenever i use combobox1.clear() it doesnt work
    try this :
    Code:
    combobox1.Items.Clear();
    combobox1.SelectedIndex = -1;
    combobox1.Text = "";
    But, I've never tried before. I don't have c# IDE or something like that

  9. #8
    gokuajmes's Avatar
    gokuajmes is offline Programming God
    Join Date
    Jan 2010
    Location
    India
    Posts
    516
    Blog Entries
    5
    Rep Power
    12

    your help is here

    I am sure ,that you got something wrong with the syntax or referencing the wrong comb box it happens you know even with the experienced developers

    try the code below
    Code:
     ComboBox1.Items.Clear();
    ComboBox1.DataSource = DataAccessLayer; //you need to figure the data logic to use
    ComboBox1.DataBind();

  10. #9
    nero29 is offline Newbie
    Join Date
    Mar 2010
    Posts
    12
    Rep Power
    0

    Re: your help is here

    Quote Originally Posted by gokuajmes View Post
    I am sure ,that you got something wrong with the syntax or referencing the wrong comb box it happens you know even with the experienced developers

    try the code below
    Code:
     ComboBox1.Items.Clear();
    ComboBox1.DataSource = DataAccessLayer; //you need to figure the data logic to use
    ComboBox1.DataBind();
    i am sorry i am just a newbie i dont know how to make this code work. the DataAcessLayer part wats that? cause i get some error regarding that one and also the databind code sorry i am just a newbie. if you want i will post my codes here for you guys to check wats wrong with my code

  11. #10
    gokuajmes's Avatar
    gokuajmes is offline Programming God
    Join Date
    Jan 2010
    Location
    India
    Posts
    516
    Blog Entries
    5
    Rep Power
    12

    Re: help

    So you say you are a Newbie and you managed to create that application
    anyways let me write you a better explanation after i come from work,if that is ok with you

    by the way post the code / the place only where its not working ,a line or 2 above and line or 2 below the error causing statement.[Dont post the whole code ]

Closed Thread
Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts