J
joey.powell
I have a datagridview where I set its "DataSource" property to a
DataSet and its "DataMember" property to a table within the DataSet. I
need for the DataGridView to "sort" through the contents of the DataSet
as it binds. Can I specify a column on the DataSet that, sorted, will
control the order of the rows in the datagridview? It seems to just
parse over the data in the DataSet and bind to it, without my being
able to control the order that it acquires the records.
I can call myDataGridView.Sort(myColumn,ListSortDirection.Ascending)
after the bind, but the indeces of the datagridview rows do not get
changed when the rows are reordered. To be able to use "Move Up" and
"Move Down" buttons, I need for the indeces to match the order of
values of a certain column in the DataSet (i.e. 0, 1, 2). But the
values are not stored in order (i.e. 0,1,2) etc in that DataSet. They
may be random.
DataSet and its "DataMember" property to a table within the DataSet. I
need for the DataGridView to "sort" through the contents of the DataSet
as it binds. Can I specify a column on the DataSet that, sorted, will
control the order of the rows in the datagridview? It seems to just
parse over the data in the DataSet and bind to it, without my being
able to control the order that it acquires the records.
I can call myDataGridView.Sort(myColumn,ListSortDirection.Ascending)
after the bind, but the indeces of the datagridview rows do not get
changed when the rows are reordered. To be able to use "Move Up" and
"Move Down" buttons, I need for the indeces to match the order of
values of a certain column in the DataSet (i.e. 0, 1, 2). But the
values are not stored in order (i.e. 0,1,2) etc in that DataSet. They
may be random.