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

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -