Click to See Complete Forum and Search --> : DataGrid retrieving data from other table for each item
HairyMonkeyMan
November 7th, 2005, 10:21 AM
Hi,
I'm still pretty new to asp.net. I am populating a datagrid with project data.
I am wanting to lookup datafrom another table that relates to each item in the list. Is it possible to write code that executes for each new line of the grid? (and render the data)
Hope you understood that,
Thanks :wave:
Rohit Kukreti
November 8th, 2005, 10:45 AM
What exactly you want? You want to show data from two related tables then please use Datarelation else please clarify
mmetzger
November 8th, 2005, 10:49 AM
Based on what you said, it sounds like you're looking for the ItemDataBound event. This runs for each row from the table when loaded. You can do pretty much anything in there, including run selects on dataviews / etc. Depending on how you're doing this Rohit's suggestion of the relations should work well.
HairyMonkeyMan
November 8th, 2005, 11:48 AM
Thank you both for the replies,
Yes, I am wanting to show related data in the same grid. I have a project data table and a project_fees data table. I want to display some information from the project, then directly underneath each project I will show all the project fees that relate to that project, and hopefully use the builtin ability of the grid to edit the data.
I will look into the 'ItemDataBound' event.
Sorry for being unclear...
Thanks :wave:
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.