We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GDBG - How to specify row order?

Thread ID:





20438 Oct 19,2004 09:03 AM UTC Oct 19,2004 09:17 AM UTC Windows Forms 1
Tags: GridControl
Steve Gauthier
Asked On October 19, 2004 09:03 AM UTC

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. --Steve

Administrator [Syncfusion]
Replied On October 19, 2004 09:17 AM UTC

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.)


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon