# .NET and More > WPF, WCF, WF >  How to accomplish multi-column, hierarchical data entry

## HongKongCV

I am using Visual Studio 2012, developing C# WPF on Windows 7.

I have a situation where I need to support viewing and modification of data in a DataGrid-style interface, only supporting child rows... editable in-place. Think of a data set where the root nodes are courses being taught at a university, and the child nodes are the students taking each class. Not exactly realistic, but it gets the point across... only two levels of data, so its not nested deep. Both the parent and the child data have multiple columns that need to be editable.

I want the user to be able to move up and down through the data, editing both parent and child data, expanding and collapsing the parent nodes at will. It needs to support textbox editing, as well as combo and check boxes. I should be able to find the selected row, and the parent or children of that selected row. It will be bound to an observablecollection formatted the same way, i.e. each node in the collection will contain an observablecollection pointing to any children it might have. It needs to support both single-row and multi-row selection.

DataGrid doesn't work, because it doesn't seem to support a hierarchical structure. Treeview does, but it isn't multi-columnar. I don't want to spend money on a third-party control, but there has to be an option to do something like this... it's far too common a scenario. Just looking for suggestions... and I'm okay doing extra coding to make the thing behave properly.

Any suggestions are appreciated.

----------


## techgnome

Third party is really the only way you're going to get this unfortunately. 
Company I used to work for used the Infragistics Ultra Grid for this very kind of stuff.

-tg

----------


## HongKongCV

We did for a while, as well, but moved away from them a few years ago. I'm actually developing to replace an app we developed using Infragistics controls... this is really the only functionality that I need to get. Using a datagrid for each level of data just isn't cutting it.

----------


## Spooman

HK

What about 2 Flexgrids?

Seems like it might work using VB6
I imagine that there is a comparable control in VB.Net

Spoo

----------


## KGComputers

Perhaps customizing the datagrid to handle row details feature.

How to: Add Row Details to a DataGrid Control
grouping-in-datagrid-in-wpf
wpf-datagrid-rowdetailstemplate-in-wpf.html

----------


## HongKongCV

What I'm trying now is a DataGrid with an expander containing a second DataGrid. I'm in the early stages of building it now, but the POC application seemed to work fine.

----------

