Editing a datagrid nested within another datagrid

Discussion in 'ASP .Net Datagrid Control' started by uk00121, Apr 14, 2004.

  1. uk00121

    uk00121 Guest

    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.
     
    uk00121, Apr 14, 2004
    #1
    1. Advertising

  2. 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

    "uk00121" <> wrote in message
    news:...
    > 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.
     
    Michael Tkachev, Apr 16, 2004
    #2
    1. Advertising

  3. uk00121

    uk00121 Guest

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

    "Michael Tkachev" <> wrote in message news:<>...
    > 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
    >
    > "uk00121" <> wrote in message
    > news:...
    > > 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.
     
    uk00121, Apr 19, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vili
    Replies:
    1
    Views:
    541
    S. Justin Gengo
    Mar 31, 2006
  2. Replies:
    0
    Views:
    601
  3. Ultrus
    Replies:
    3
    Views:
    390
    Stefan Behnel
    Jul 9, 2007
  4. Andrew Jocelyn
    Replies:
    2
    Views:
    1,540
    Allen Chen [MSFT]
    Apr 27, 2009
  5. Roy

    Quick! Simple method for editing a nested datagrid!

    Roy, Jan 25, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    121
Loading...

Share This Page