Is there a way to assign explicitly the order that the table rows must be sorted? The sort is not ascent / descent. I need it to synchronize two GDBG that are linked to different DataTable.
For example... a table called Person contains three columns: ID, LastName and FirstName. Another table called Address contains three columns: PersonID (ID field of table Person), StreetName and City. The last table called Job contains two columns: PersonID (ID field of table Person) and Company.
When a person is created in the table Person, I automatically create a row for the tables Address and Job. In my DataSet, there is always one Address and one Job for each Person.
In a dialog I need to show for persons whith ''LastName = Smith'' (DataView with filter) the information coming from Address and Job tables. I use a GDBG for the Address table and another GDBG for the Job table. The user can edit the values in the grid.
When the user will sort the Address grid by City, I want to keep the Job grid synchronized with the address grid (the first row in the Address grid and the first row in the Job grid must be for the same Person). That''s why I said previously that I would like to specify to the Job grid the order of my PersonID... I want to apply a "sort" that is not an ascent / descent sort related to a column of the table.
I need to specify what is the first row, the second row, the third row... based on the PersonID column.
ADAdministrator Syncfusion Team October 19, 2004 04:17 AM
One way you can do this is to add a column to your DataTable, say sortKeyCol, that holds a value that will be used to sort the DataTable. (This column would not necessarily be visible in the grid.) Then you can assign the values in the sortKeyCol column so that the table gets sorted the way you want it to be sorted. This will take some coding to do. (You can actually do the same thing without adding a column to teh table, just having stand-alone index column, but this would take significantly more code to implement.)