int PageID = -1;RackEntities re = new RackEntities();private void PageList_Load( object sender, EventArgs e ) { var pageListQuery = from p in re.pages where p.page_id != -1 select new { PageID = p.page_id }; GridViewPage.DataSource = pageListQuery; var pageImageListQuery = from pi in re.page_image where pi.page_id == PageID select pi; GridViewPageImage.DataSource = pageImageListQuery; }
private void GridViewPage_SelectionChanged( object sender, EventArgs e ) { var pageImageListQuery = from pi in re.page_image where pi.page_id == //PageID select pi; GridViewPageImage.DataSource = pageImageListQuery; }
Attachment: RackEditor.zip