如何在datagridview中的一列中显示两列 [英] How to show two columns in one column in the datagridview

查看:413
本文介绍了如何在datagridview中的一列中显示两列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想在datagridview中的datagridview的一列中显示我的数据表的两列。这可能吗?



谢谢

解决方案

正如PIEBALDconsult所说,你可以在SQL中组合这些值。



  SELECT  field1 + ' ,' + field2  AS  newField 





然后将newField添加到你的网格。


我在这里找到了解决方案





https://social.msdn.microsoft.com/forums/windows/en-us/db5efb1f-8196-42aa-971c-81ca45ef89b2/combining-bound-column-data-in-datagridview [ ^

Hi,
i want to show in my datagridview two columns of my datatable in one column of the datagridview. Is this possible?

Thanks

解决方案

As PIEBALDconsult said, you can combine the values in SQL.

SELECT field1 + ', ' + field2 AS newField 



and then add newField to your Grid.


I found the solution here


https://social.msdn.microsoft.com/forums/windows/en-us/db5efb1f-8196-42aa-971c-81ca45ef89b2/combining-bound-column-data-in-datagridview[^]


这篇关于如何在datagridview中的一列中显示两列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆