开发者

Can I use a combobox in a programmatically bound datagrid C#

开发者 https://www.devze.com 2023-04-12 23:06 出处:网络
I am using entity framework and binding to a datagrid to display the results of my query.Instead of showing the foreign key from the result, I would like to 开发者_开发技巧show the more meaningful val

I am using entity framework and binding to a datagrid to display the results of my query. Instead of showing the foreign key from the result, I would like to 开发者_开发技巧show the more meaningful value from the lookup table and limit the users input by using a combobox too.

Is it possible to use a combobox in a programmatically bound datagrid on a winform? If so - how?

Thanks in advance,

James


There is a column type for a combobox in a DataGridView: http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcolumn.aspx

For changing the display value you can use this event: http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellformatting.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消