I have a DataGridView which takes a datasource from a Datatable. I have added in a new row into the datatable which adds the total values of the Columns and this displays fine until the Header is clicked and then the data is sorted and my Totals Row appears half the way up my grid!
I have been looking for a solution for this for hours now and can't seem to find anything concrete. I've seen people overriding the SortCompare method, but this doesn't get used when there is a datasource. I've seen mentions of a Footer, however this seems to be primarily ASP, but I have seen bits and pieces of broken code for windows applications.
Basically all I want to do is have my count column at the bottom of the grid and it stays there when I click on the headers! I thought this would be a fairly straight forward bit of work but it's proving to be tricky.
My grid is made up of 4 or 5 main columns of data, Name, Position etc and the rest of the columns are dates based on a filter, so those are fairly dynamic.
Your help is much appreciated.
Aucun commentaire:
Enregistrer un commentaire