Options
How can I set a View\edit DataGridview query to return results in ascending order
Hello
I would like to be able to amend the basic View\edit DataGridView query "mytable.Take(100)" command so that It will sort the data by date or newest ID and then allow me to edit whilst still in the DataGrid view
Can anybody help me?
Regards
Ian
I would like to be able to amend the basic View\edit DataGridView query "mytable.Take(100)" command so that It will sort the data by date or newest ID and then allow me to edit whilst still in the DataGrid view
Can anybody help me?
Regards
Ian
Comments
.OrderByDescending(x => x.ID)
or whatever the ordering should be. You can also use .Where(...) to pre-filter your data etc.
You can also just remove the .Take call and use a .Where filter instead to display a more meaningful subset of your data
Thank you, the ".OrderByDescending(x => x.ID)" solution worked perfectly.
How could I amend the basic "mytable.Take(100)" command so I can request a specific record to be returned by ID number?
Regards
Ian
In you example above if I wanted to return a specific record ID of "1500" where would that fit into your query above?
Cheers
Ian