Dropdownlist in datagrid
-
hi all, i want to know how to select as item from the dropdownlist in the datagrid and have the textbox in the datagrid filled with the corresponding value from database. for eg if i select product name from dropdownlist then the textbox in datagrid must be populated with the price from the database for the corresponding product name. p.s. i know how to add items from db in dropdownlist which is in datagrid i just want to know the code for how to select the item from dropdownlist in the datagrid and have the textbox in the datagrid filled with the corresponding value from database.
-
hi all, i want to know how to select as item from the dropdownlist in the datagrid and have the textbox in the datagrid filled with the corresponding value from database. for eg if i select product name from dropdownlist then the textbox in datagrid must be populated with the price from the database for the corresponding product name. p.s. i know how to add items from db in dropdownlist which is in datagrid i just want to know the code for how to select the item from dropdownlist in the datagrid and have the textbox in the datagrid filled with the corresponding value from database.
There are some good article w/ code examples on dotnetjohn.com that discuss dropdown, check boxes and such in datagrids just like you are looking for. Al
-
hi all, i want to know how to select as item from the dropdownlist in the datagrid and have the textbox in the datagrid filled with the corresponding value from database. for eg if i select product name from dropdownlist then the textbox in datagrid must be populated with the price from the database for the corresponding product name. p.s. i know how to add items from db in dropdownlist which is in datagrid i just want to know the code for how to select the item from dropdownlist in the datagrid and have the textbox in the datagrid filled with the corresponding value from database.
Hi there, You can create an event handler for the SelectedIndexChanged event of the DropDownlist, and also remember to the AutoPostBack property to true. When the user selects a new value from the dropdownlist, the page posts back to the server, and you can provide a snippet of code in the event handler of the SelectedIndexChanged to pull out the value from DB and assign it to the textbox in that row. You can find the site datagridgirl[^] tons of datagrid examples.
-
There are some good article w/ code examples on dotnetjohn.com that discuss dropdown, check boxes and such in datagrids just like you are looking for. Al
thanks Al Ortega for taking the time to read my doubt and reply. i'll check out the site
-
Hi there, You can create an event handler for the SelectedIndexChanged event of the DropDownlist, and also remember to the AutoPostBack property to true. When the user selects a new value from the dropdownlist, the page posts back to the server, and you can provide a snippet of code in the event handler of the SelectedIndexChanged to pull out the value from DB and assign it to the textbox in that row. You can find the site datagridgirl[^] tons of datagrid examples.
thanks minhpc_bk for taking the time to read my doubt and reply. thanks for the info.i'll check out the site