Binding DataGrid TemplateColumns to ChildTable of DataSet

Discussion in 'ASP .Net Datagrid Control' started by Axel Reimann, Apr 7, 2004.

  1. Axel Reimann

    Axel Reimann Guest

    Hi!

    I'm quite frustrated because i'm stuck in a problem i couldn't solve
    so far: i have a dataset, containing 9 Tables (1 master-table, 8
    child-tables, with master-child-relations set). in the .aspx-page, i
    have a DataGridControl, bound to the master-table of the dataset. As
    long as i user bound columns in the datagrid, it's no problem to bind
    them to the corresponding fields of the master-table by
    "DataField=<FIELD_NAME>".
    My problem is to use TemplateColumns in the DataGrid, that are bound
    to corresponding fields of a child-table.
    This was a (unsucsessful) try:
    <ItemTemplate>
    <%# DataBinder.Eval(((DataRowView)Container.DataItem).Row.GetChildRows(<NAME_OF_RELATION>),
    "[<NAME_OF_FIELD_IN_CHILD_TABLE>]") %>
    </ItemTemplate>

    I tried several combinations :) but nothing worked!

    Can anyone HELP ME ???

    Thanks in advance,

    Axel
     
    Axel Reimann, Apr 7, 2004
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.