My data table controls

Source: Internet
Author: User

Download griddll demo

My editing environment is vs2005 and the language is C #, because in actual software development, controls such as DataGrid or datagridview are often used to display and edit data, therefore, the data table control is a very important control for us. I have used DataGrid before, and it is very difficult to achieve a certain effect, such as specifying the column editing control, selecting the entire row, displaying the row number or adding a total row, fortunately, all of them have been solved, but the function of adding fixed columns to the DataGrid control has not been implemented, so I feel impatient .......

Later, Microsoft added a new datagridview control under vs2005, which supports the fixed column function, which is indeed more powerful than the DataGrid Control, I was a little disappointed when I started to use this control excitedly. Nothing else, I felt that the control was too slow to be refreshed, and it was difficult to display the control ...... there is no way to use it first, but there are new requirements later. For example, the row display requires that data in the same column be merged to display together, in a column, a diagonal line like an Excell cell is required ........ oh, my God. How can this happen!

After several thoughts, I finally decided to write a grid myself! Only in this way can I use it easily!

How to Write it? First, I decided how to implement grid painting. I know that dual buffering can solve many display Difficulties in drawing graphics, and vs2005 has good support for this function, so I started my idea of implementing grid for a long time. first, define the columns in the grid to display the column title, define the Edit Control, column type, length, alignment, and merge fixed attributes with diagonal lines, define the drawer of the grid, and use this object to draw the entire grid. When there is a paint message or a sizechanged message, orProgramWhen there is a requirement to refresh, this loyal class is used to fulfill its great mission for me. because you need to edit data, you also need to define edit controls for columns, such as text, numeric, and date.

Thanks for my bold attempt. I finally completed my idea and implemented my own data table grid!

After N practical applications, I improved the grid once, and now I finally took it out to view it with you :)

In terms of functions, it includes column merging, fixation, data printing and previewing, and XML format generation. It provides a wide range of events and methods, if you are interested, download and try it out. Please do not hesitate to give us your advice!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.