This is a migrated thread and some comments may be shown as answers.

hiding rows based on info from collection

0 Answers 49 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Keith Stephens
Top achievements
Rank 1
Keith Stephens asked on 08 Jun 2010, 08:56 PM

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;  
              
        } 

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Keith Stephens
Top achievements
Rank 1
Share this question
or