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?
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
@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?
help everyone
guys could someone tell me how do i refresh my combobox and clear it? cause whenever i use combobox1.clear() it doesnt work
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() ; } }
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 codesorry i am just a newbie. if you want i will post my codes here for you guys to check wats wrong with my code
![]()
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 ]
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks