View Single Post
 
Old July 30th, 2014, 12:49 AM
mmorgan30 mmorgan30 is offline
Friend of Wrox
Points: 528, Level: 8
Points: 528, Level: 8 Points: 528, Level: 8 Points: 528, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2014
Posts: 136
Thanks: 1
Thanked 10 Times in 10 Posts
Default

I am better with c# so ill show in c#. Not knowing exactly what your gridview looks like, I am assuming its dates as column headers based on your for loops. I am also free handing this, so it may contain some compile errors. The point is how i am doing it.


Code:

// Select all column header text as dates
var gvColumnDates = dgvWaterfall.Columns.Select( c => Convert.ToDateTime(c.HeaderText) );

// now select the schedules that have dates in the gridview headers that have someId as milestonestatus id
var queryResults = eReportContext.MilestoneWeekendSchedules.Where( s => s.MilestoneStatusId = someid && gvColumnDates.Contains( s.WeekendDATE ) ).ToArray();

Last edited by mmorgan30; July 30th, 2014 at 12:53 AM..