In a grid with a <GridForeignColumn>, the sort is apparently on the Field of the DataSource and should be on the ForeignkeyValue field, which is implied by using the <GridForeignColumn>.
This is an example of a Grid that displays Care Facilities. It uses a Facility Type lookup table to display the type of facility. The Facility Type table is dynamic as the end-user may add or delete existing facility types. Therefore, exists on its own. - a common pattern.
<GridColumns>
<GridColumn Field=@nameof(CareFacilityDto.CareFacilityId) IsPrimaryKey="true" Visible="false" />
<GridColumn Field=@nameof(CareFacilityDto.Name) Type="ColumnType.String" HeaderText="Name" Width="70"></GridColumn>
<GridForeignColumn Field=@nameof(CareFacilityDto.FacilityTypeId) ForeignDataSource=@FacilityTypes ForeignKeyField="Id" ForeignKeyValue="Name" HeaderText="Facility Type" Width="50"></GridForeignColumn>
<GridColumn Field=@nameof(CareFacilityDto.Street) Type="ColumnType.String" EditType="EditType.DefaultEdit" HeaderText="Street" Width="50"></GridColumn>
<GridColumn Field=@nameof(CareFacilityDto.City) Type="ColumnType.String" EditType="EditType.DefaultEdit" HeaderText="City" Width="25"></GridColumn>
<GridColumn Field=@nameof(CareFacilityDto.State) Type="ColumnType.String" EditType="EditType.DefaultEdit" HeaderText="State" Width="25"></GridColumn>
<GridColumn Field=@nameof(CareFacilityDto.ZipCode) Type="ColumnType.Number" EditType="EditType.NumericEdit" HeaderText="Zip Code" Width="25"></GridColumn>
<GridColumn Field=@nameof(CareFacilityDto.ContactPhone) Type="ColumnType.String" Format="d" HeaderText="Phone" Width="25"></GridColumn>
</GridColumns>
There is a single foreign key column that references a facility type lookup table, a very common practice, It uses the FacilityTypeId field from the grids DataSource to index (reference) the value that should be displayed. It is this value that should be sorted and not the key used to do the lookup of the value.
This is critical functionality and should be corrected as soon as possible.
Thanks
Mike