I posted a bit of code yesterday to make a datable with misc data in it. But, while in bed, i remembered that it has to be sorted. So, this morning, after some reading of different sites, I managed to get it working. Make the following modification:
dt.DefaultView.Sort = “column1 desc”
dt.AcceptChanges() ‘ accept the changes again, just in case
DataGrid1.DataSource = dt.DefaultView ‘ set the datasource of the datagrid to the new table
Place this code just after all loops and before the last dt.acceptchanges(). Actually remove that last dt.acceptchanges and past this code in. only problem for me is its sorting slightly wrong. Im going to see if I can fix this. I think I know whats wrong though. It sees my data as strings and there fore 99 is the first one, and 101 is somewhere afterwards. If you mod the code, check it out to see what I mean.