Sachin
Sachin

Reputation: 11

How do I display a DataGridView within a cell of another datagridview in C# forms app?

How do I display a DataGridView within a cell of another datagridview in C# forms app?

How would I have to handle Sorting & value changed if this possible?

That is the only way I can display data to make some sense.. Think of it like I have a task column and dates column. Under the dates column I have a list of things to be done. These date columns are dynamic & there might be multiple date columns

Upvotes: 1

Views: 3575

Answers (3)

Sachin
Sachin

Reputation: 11

http://blogs.msdn.com/markrideout/archive/2006/01/08/510700.aspx

Found a link where hierarchichal datagrid is implemented.

Now, I have to either modify the control, or settle for hierarchichal gridview!

Hope this helps someone. Will update later

Upvotes: 0

galford13x
galford13x

Reputation: 2531

This is a suggestion since what your asking I do not think is possible with the built in DGV of .NET.

Using custom controls made by professional companies that provides a DataGrid with the capability of hierarchical data. For example a row can be expanded to show multiple entries (the multiple entries can be an entirely different table containing completely different columns even). Here are a few options that you can check out.

Infragistics WinGrid

Component One

There are a few other places/companies that make great .NET component packages that provide added features to the existing .NET components.

Upvotes: 0

Don Kirkby
Don Kirkby

Reputation: 56590

That sounds like a difficult interface to use, have you considered some kind of tree control?

If you're determined to use data grid views, look at customizing data grid view columns and cells. You need to declare custom subclasses for the column and cell behaviour that you want. I don't know if it's possible to do what you want, but that's where I would start.

Upvotes: 1

Related Questions