Editing a datagrid nested within another datagrid


U

uk00121

I am trying to nest three datagrids within one larger grid, showing
who is working in each unit for each given shift. The final layout
looks kinda like this.

==================================================================
Unit 1
Day Shift | Evening Shift | Night Shift
---------------------|---------------------|---------------------
Person1 Title | Person3 Title | Person4 Title
Person2 Title | | Person5 Title

Unit 2
Day Shift | Evening Shift | Night Shift
---------------------|---------------------|---------------------
Person6 Title | Person8 Title |
Person7 Title | Person9 Title |
====================================================================

I've built this using both parent-child relationships as well as using
the DataSource=<%# GetDetails(container.dataitem("FieldName"))%>
method. Either way displays the data just fine, but neither allows me
to edit them. All of the data is coming out of one sql table, though
it is in several different datatables (within same dataset). This way
I could use the select distinct on the outer grid to only list each
unit one time.

Using the example above, we need to move Person5 over to Unit 2. So I
should (???) be able to add an edit button next to the name and then
generate a dropdown menu of all possible units, select the new unit,
and have the page refresh to have Person5 now working on Night shift
in Unit 2.

The problem has been identifying which row I am trying to edit. There
is the OuterGrid, DayGrid, EveGrid, and NightGrid. However, since the
latter three are all generated dynamically, the standard
"DayGrid.EditItemIndex = e.Item.ItemIndex"
command bombs out on me.

I've lost track of how many forums and websites I've been to
researching this. It seems like a fairly common question, but I've
yet to find an solution that actually works.

I'd be more than happy to send the code I've been working with, but
since I've got it partially built several different ways I'm not sure
which path is even correct anymore. Solutions for vb.net are
preferred, but at this point I'll take anything.
 
Ad

Advertisements

M

Michael Tkachev

Hi,

I solved this task looks like this,. But I used XSLT. It was really simple
than using datagrid for this solution.
Because you can get xml tree and then make transformation. If you will
create custom control with XSLT, I think you could solve this task.

bye
 
Ad

Advertisements

U

uk00121

OK, you lost me with the XSLT. No idea what that is. Could you
supply the code of your solution?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top