private static void GetSortFields(TableDefinition main, TableDefinition changes, TableDefinition tableDefinition) { var source = changes.SortColumns.Any() ? changes : main; foreach (var sortField in source.SortColumns) { tableDefinition.SetSortColumn(sortField.Field, sortField.SortOrder, sortField.SortIndex); } }
/// <summary> /// Define that the table should be sorted by a field. Calling this method will result in differences for the table being sorted by this field in ascending order. /// <remarks>To sort by multiple fields, call this method multiple times.</remarks> /// </summary> /// <param name="fieldName">The sort field</param> public TableDefiner Sort(string fieldName) { _tableDefinition.SetSortColumn(fieldName, SortOrder.Ascending); return(this); }