有没有办法从绑定源自动在表单上生成控件? [英] Is there a way to auto generate controls on a form from a binding source?

查看:61
本文介绍了有没有办法从绑定源自动在表单上生成控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我向Windows窗体添加绑定源时,有没有一种快速的方法来用绑定对象的所有属性填充窗体?



拖动并

解决方案

在Visual Studio中,


When I add a binding source to my windows form, is there a quick way to populate the form with all the properties of the bound object?

A drag and drop Field List, similar to that found in many report writers would be good.

解决方案

In Visual Studio, the Data Sources Window displays the data sources in your project. You can use Data Source Configuration Wizard to create and edit data sources from databases, services, or objects. After creating data sources in your project, you can use the Data Sources window to create data-bound controls in your user interface by dragging items from the window onto a design surface in your project:

  • Show Data Source Window from menu View > Other Windows > Data Sources or by using its shortcut Shift+Alt+D.

  • Add new Data Source using Add new Data Source toolbar button in Data Source Window or using menu Project > Add New Data Source.

  • Open a form and then in Data Source Window Set the Control to be created when dragging from the Data Sources Window. If you choose details mode in Data Source Window, for each field of data source a control will be placed on the form. If you choose DataGridView mode, DataGridView will be placed on the form.

这篇关于有没有办法从绑定源自动在表单上生成控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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