| C1.Data.2 Assembly > C1.Data Namespace > C1DataSet Class : SetTableViewRows Method |
'Declaration Public Sub SetTableViewRows( _ ByVal tableViewName As System.String, _ ByVal tableRows As System.Collections.ICollection, _ ByVal fillSort As System.String _ )
public void SetTableViewRows( System.string tableViewName, System.Collections.ICollection tableRows, System.string fillSort )
The rows are passed in as the tableRows collection. Elements of this collection are pointers to table rows:
For a table view based on a simple table: C1DataRow objects, rows of the corresponding table.
For a table view based on a composite table: arrays of type C1DataRow[], with length equal to the number of "main" simple tables in the composite table ("main" means connected to its parent with a 1-M relation, not with an M-1 one). That is, every element of the list is an array of table rows, one for each "main" constituent table. A composite table can also contain "linked" constituent tables (connected to their parents with M-1 relations). Since "linked" rows can be uniquely located given the values in "main" rows, they are not used here.
The input collection of rows can be obtained by one of the two methods.
After table view rows are created, they are sorted according to the fillSort argument. The sort syntax is the same as in the C1.Data.SchemaObjects.TableView.C1.Data.SchemaObjects.TableView.FillSort property, for example, "CustomerID, OrderDate DESC" (DESC means descending order). If fillSort is empty, the value of C1.Data.SchemaObjects.TableView.C1.Data.SchemaObjects.TableView.FillSort property is used for sorting. If that is empty, the rows are sorted by primary key.