views:

246

answers:

3

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

Thanks, Sachin

Update- Just another ASP.NET developer, struggling with C# WinForms app :(

+1  A: 

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.

Don Kirkby
1. I am looking for edit functionality (user should be able to edit a value), and not sure how treeview is going to fit into this.2. The link definetly gives me a starting point. I will try this approach too..Will update status post weekend..
Sachin
P.s: Thanks :)!
Sachin
A: 

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.

galford13x
@galford13x: I would love to use one of these, but this is not a sponsored project. Cannot afford the license. :(
Sachin
A: 

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

Sachin