Click here to Skip to main content
15,889,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I have a Listview DataControl which i am binding to a table, I have another dependent Table called COMMENTs which i what to attach as a single column to the main listview but will have multiple records(comments) for a single record from the first(main) table, how do i achieve this?

Thanks very much,
Chetan.
Posted

1 solution

You have to put Repeater control inside the Main listView cotrol. And then you need to add code for
C#
listview_rowdataboud(..)
{
//   you have to find repeater control herr...
    Repeater repcomment = e.row.findcontrol("your repeater control id");
    repcommnet.DataSource = getComment(id)
    repcommnet.DataBind();
}

getComment(int id)
{
    //here is the logic to get comments from database and return datatable
    return dt;
}

Note: this is code snippet, it something link this, you have to write proper code for the same.

Thanks,
Imdadhusen
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900