在DataGridView中显示主行和子行。 [英] Display master row and child row in DataGridView.

查看:197
本文介绍了在DataGridView中显示主行和子行。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

b


我想显示DataGridView主行中的sql数据库的column1,column2和column3,column4,column5,column6和column7将显示在可扩展的子行中。  


请帮帮我。




解决方案

您好,


使用标准DataGridView(一个例子),而你需要一个自定义DataGridView加上重新思考数据源,因为子行
将属于另一个表,然后通过DataSet在两者之间设置DataRelationship。


以下显示了如何设置主/详细信息但不是您正在寻找的视觉效果,因此请关注如何加载数据


Hi,

I want to display column1, column2 and column3 of sql database in DataGridView master row and column4, column5, column6 and column7 will display in expandable child row. 

Please help me.


解决方案

Hello,

What you want does is not possible with the standard DataGridView (one example), instead you would need a custom DataGridView plus re-think the data source in that the child rows would belong to another table and then setup a DataRelationship between the two via a DataSet.

The following shows how to setup for master/detail but is not something visually you are looking for so focus on how data is loaded instead.


这篇关于在DataGridView中显示主行和子行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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