I currently have a collection that I bind to a tabcontrol and on the tab control are grids that get bound to items in the collection.
Everything as of now work just fine. Now I need to be able to populate the tabs based on some date that we have.
Since I already have everything I need and the page is running fine.
I thought I would put a checkbox on the page then if the box is checked or unchecked I could do some linq on the collection and then just bind the tab control to a new collection.
Here is what I am trying to do, this comes from a wcf proxy call
void proxy_GetAgtAgreeFromPortCompleted(object sender, AgtAgreeFrm.NoteSVC.GetAgtAgreeFromPortCompletedEventArgs e) |
{ |
AgreementList = e.Result; |
if (Convert.ToBoolean(chkHistory.IsChecked)) |
{ |
var query = from alist in AgreementList |
where Convert.ToDateTime(alist.EndDate) <= DateTime.Now.Date |
select alist; |
//tabControl1.ItemsSource = query; //AgreementList; |
} |
else |
{ |
var query = from alist in AgreementList |
where Convert.ToDateTime(alist.EndDate) > DateTime.Now.Date |
|| Convert.ToDateTime(alist.BeginDate) > DateTime.Now.Date |
select alist; |
//tabControl1.ItemsSource = query; |
} |
tabControl1.ItemsSource=query |
//tabControl1.ItemsSource = AgreementList; |
//AANoteBody = //Note.NoteBodyLines; |
//NoteBodyLines.Add(new NoteSVC.TshipNoteBody()); |
//grdNoteBody.ItemsSource = NoteBodyLines; |
//List<NoteSVC.AANote> Notes = new List<NoteSVC.AANote>(); |
//Notes = Agreement.Note; |
//ObservableCollection<NoteSVC.AANote> NotesNotes = Notes[0].; |
//cboPorts.Items.Clear(); |
//cboPorts.ItemsSource = PortList; |
//string x = AgreementList[0].Notes[0].Lines[0].ToString(); |
//this.gdvNotes.ItemsSource=; |
//public ObservableCollection<NoteSVC.TshipNoteBody> NoteBodyLines; |
//List<NoteSVC.AANote> Notes = new List<NoteSVC.AANote>(); |
//Notes = AgreementList[0].Notes; |
//NoteNoteBodyLines = Note.NoteBodyLines; |
//NoteBodyLines.Add(new NoteSVC.TshipNoteBody()); |
//grdNoteBody.ItemsSource = NoteBodyLines; |
} |