Tailor Your DataGrid Apps Using Table Style and Custom Column Style Objects

      One of the most enduring challenges in writing user interfaces is figuring out how to display large amounts of data efficiently and intuitively without bewildering the user. The problem becomes particularly thorny when the interface must reflect hierarchical relationships within the data that the user needs to modify. The Windows Forms DataGrid control gives developers a powerful and flexible tool to meet this challenge. This article explains its basic operations and shows how to extend the DataGrid to display columns of data in an application-appropriate manner.

      The DataGrid is one of the most powerful Windows® Forms controls. By using default DataGrid property settings you can easily bind a DataSet to a DataGrid to create an impressive Windows Forms user interface—one that allows users to drill down through multiple levels of hierarchical data and sort and reorder columns. While it is easy to get started with the DataGrid control, leveraging its more sophisticated capabilities—for example, creating custom column displays—remains lightly documented and requires some trial and error. In this article I will explain how to bind to a DataGrid, illustrate the basic features of the control, and show how to exercise extensive control over the appearance and behavior of tables and columns. Finally, I'll demonstrate how you can extend the DataGrid control with custom column style objects by implementing a type that displays column values in a dropdown combobox.

Tailor Your DataGrid Apps Using Table Style and Custom Column Style Objects

参见MSDN

http://msdn.microsoft.com/zh-cn/293d3a86-fc59-44cf-a8f1-bad799457e79


 

你可能感兴趣的:(datagrid)