Here my question: How can I make a custom layout for a DataGridView in C# ?
I try to work with the object DataGridView and I think it's the best for making what i want but I can't find how I can merge 2 cells or more from one column. I'm sure that is already exist but I can't find something on the web. What I want, is a excel like grid
Here a example of what I want to make.
Example of array:
Group =
[
Cell 1, [Cell 1, Cell 2],
Cell 2, [Cell 1, Cell 2, Cell 3],
Cell 3, []
];
Example of what I want to do :
I think it's better to use a custom grid control. Or you may want to use the XL sheet control of devexpress which is not free. Another option is to use EPPlus → ( http://epplus.codeplex.com ).
The only way I know of to accomplish this is by either one of the following options:
CellPaint
events properly. I've personally done this in projects where I need basic cell merging capabilities. There is no built-in method of performing a merge-cells option in a WinForms DataGridView.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.