Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
304 views
in Technique[技术] by (71.8m points)

.net - Is there a way to auto generate controls on a form from a binding source?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

enter image description here enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...