c# - Problem displaying a linq query in a datagridview -


Hello: I am working on a C # project that reads an XML file and returns a list of lists. When I want to display a list, I do this:

  IEnumerable & lt; Foo & gt; MyFooQuery = Of MyLists Select T start-down blocking by order (L = & gt; L. bar) in the selection; DataGridView1.DataSource = myFooQuery.ToList ();  

My problem is that when I do this, you can not click the Data Header to sort the DataGrud view. I tried your follicles. Encunable (), but then nothing shows up in the datagrid view, even if I expect the calculation of the query. Am I clear about something, or what do I have to use? (?)? You can try:

  Enumeral Collection & lt; DataRow & gt; MyFooQuery = Of MyLists Select T start-down blocking by order (L = & gt; L. bar) in the selection; Dataview myDataView = myFooQuery.AsDataView (); DataGridView1.DataSource = myDataView;  

Edit - Line commented

// dataGridView1.DataBind ();


Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -