Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Dear sir

now i have a form with datagridview which has inside it datagridcomboboxcolumn binded to mysql DB table , now i want to be able to add a new item to this combobox in runtime

after many thinking & searching , there is two ways for that and all having problems to be done

1st : the best pretty method
enabling typing in the combobox and if these word not in the list call function for ex: AddToDB(string Newitem) then refresh the combobox
problems: 1st problem enabling types there is a code in many sites (enable dropdown style and then compare the new item and if it is new add it ) but it didn't work well sometime i readd an already exist items , 2nd problem i failed failed failed to refresh/ update the items in the combobox

2nd : less pretty method
to add to the end of the list a word NEW or Add for example and handle endedit event and then pop an input box to enter the new item and then call function for ex: AddToDB(string Newitem)then refresh the combobox datagridcomboboxcolumn items

thanks all bye

the problem : 2nd problem i failed failed failed to refresh/ update the items in the combobox

so i need all your help and tips , i wish to be able to make the 1st method and if not then the 2nd one and in all cases i want to know how to refresh
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900