Windows Develop Bookmark and Share   
 index > Windows Forms General > How to split a cell to some lines in DataGridView in C#
 

How to split a cell to some lines in DataGridView in C#

I have one requirement to show a DataGridView with splited cells.
eg. we have normally 4 rows and 4 columns of DataGridView. but i need to split the cell in first row and first column to 4 sub rows. and the cell in the 3rd row and first column to 2 sub rows .... and so on...

it is something like that:

_______________
1A | | 1a |
1B | | 1b |
1C |
| 1c |
1D |
| 1d |
2 | | 2 |
3A |
| 3a |
3B | | 3b |
4 | | 4 |


How can i do that? thx a lot~
IceDiam0nd  Tuesday, September 15, 2009 1:53 PM
There is nothing that I know of in the standard data grid view to split cells. You will either need to write your own grid control to do this or check out third party controls.

Hope this helps.
www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
  • Marked As Answer byIceDiam0nd Tuesday, September 15, 2009 4:08 PM
  •  
DeborahK  Tuesday, September 15, 2009 3:13 PM
Here are some third party grids:

http://www.devexpress.com/Products/NET/Controls/WinForms/Grid/

http://www.componentone.com/SuperProducts/FlexGridWinForms/

Hope this helps.
www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
  • Marked As Answer byIceDiam0nd Tuesday, September 15, 2009 3:58 PM
  •  
DeborahK  Tuesday, September 15, 2009 3:38 PM
There is nothing that I know of in the standard data grid view to split cells. You will either need to write your own grid control to do this or check out third party controls.

Hope this helps.
www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
  • Marked As Answer byIceDiam0nd Tuesday, September 15, 2009 4:08 PM
  •  
DeborahK  Tuesday, September 15, 2009 3:13 PM
i have no idea to write my own grid control to do that. could u give me a simple example? or do u know some kinds of third party controls can do that as well?

Thanks,
IceDiam0nd  Tuesday, September 15, 2009 3:17 PM
Binging found this:

http://www.codeproject.com/KB/grid/csharpgridcontrol.aspx?fid=14109&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=201&select=1835489#xx1835489xx

But it is not for the faint of heart.
www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
DeborahK  Tuesday, September 15, 2009 3:35 PM
Here are some third party grids:

http://www.devexpress.com/Products/NET/Controls/WinForms/Grid/

http://www.componentone.com/SuperProducts/FlexGridWinForms/

Hope this helps.
www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
  • Marked As Answer byIceDiam0nd Tuesday, September 15, 2009 3:58 PM
  •  
DeborahK  Tuesday, September 15, 2009 3:38 PM
: ( they are need to be paid...
IceDiam0nd  Tuesday, September 15, 2009 4:48 PM

You can use google to search for other answers

Custom Search

More Threads

• Is there a way inside the ToolStripMenuItem.DropDownOpening event to cancel the event inside the handler?
• please help - Bind 1 column in a dataset to dropdown
• .Net Crystal Reports + Dataset + Logon Failure Error
• How to display a form from another one
• RichTextBox.GetLineFromCharIndex(RichTextBox.SelectionStart)
• Mouse Clicked on what?!?!?
• PropertyGrid & Drop down lists
• retain blue background on listview selected item when focus leaves listview
• How To Open A Particular Page in hlp File Using C#
• Which event to use with ListView items selection?