Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The easy part of this implementation was done pretty quickly. I created a linq query and set it as the datasource of my datagridview. what i am now trying to do is set one of the columns, created by the linq query, to a datagridviewcomboboxcolumn. also i want this columns datasource to be an array of strings, not another database table.

what i have done currently is adding an additional column as datagridviewcomboboxcolumn and manually changed the database property to the selected item. but with this solution comes one big problem: when the form reloads i am unable to restore the selected items to be the 'formattedvalue' property of each combobox.I am not posting that code, because except to that point it works well.
Posted

1 solution

Alternative solution is to write a stored procedure in the back end, which fetches the data base elements/columns and the user populated data. With this approach, you can assign the direct source from DB.
 
Share this answer
 
Comments
pritdesai 1-Sep-11 4:51am    
okay but at this point i am still not able to modify the table at runtime. i now came to the conclusion to do everything manually using this guys work: http://www.codeproject.com/KB/list/CustomListView.aspx. The performance is not that good but with listView I have access to every single aspect of the table. IMHO the datagridview solution is a complete failure.

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