在vb.net中在datgrid视图中一一显示多个表 [英] display multiple tables in datgrid view one by one in vb.net

查看:101
本文介绍了在vb.net中在datgrid视图中一一显示多个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..

我想在vb.net的单个datagridview中一个接一个地显示多个表.
我已经使用组合框选择了用户想要在datagrid中显示的表.当我第一次选择任何表时,该表将显示在datagrid中,但是稍后,如果我从组合框中选择了任何其他表,则该表将不会显示.已在datagrid中选择了第一个遗留物.

请帮帮我...

解决方案

Soooooo,您在ComboBox事件中使用的代码是什么,它将选择新表并将其绑定到DGV ??


如果我没有从组合框中选择任何其他表,则该表不会显示.我首先选择的表保留在datagrid中.
如果您将共享代码,那将更加简单.

当前,根据需要,在comboxselectedchange事件中需要做的所有事情,根据组合框中的选定值获取新数据,重置网格的数据源.
使用BindingSource方式刷新数据,因为它看起来最干净.
请参阅:使用已更新的数据更新datagrid视图 [ 解决方案

Soooooo what''s the code you''re using in the ComboBox event that selects the new table and binds it to the DGV??


if I select any other table from combo box its not getting displayed.The one which I had selected first remains in datagrid.
If you would have shared the code, it would had been much simpler.

Currently, based on what you want, all you need to do in comboxselectedchange event, get the new data based on the selected value in combobox, reset the datasource of grid.
Use BindingSource way to refresh the data as it looks the cleanest to handle.
Refer:
Update datagrid view with updated data[^]


这篇关于在vb.net中在datgrid视图中一一显示多个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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