Re: Sort DataGridView
- From: "DBC User" <dbcuser@xxxxxxxxx>
- Date: 27 Jul 2006 14:48:10 -0700
Hi Joey,
I had the same problem and I did a post on this group and I got an
answer saying you have write methods to handle it manually.
What I did is to make a key and as I move up and down, I use the key to
identify the corresponding row in the dataset for further processing.
Thanks.
I associate a datasource to datagrid and then allow the user to sort
the data. I keep the row
joey.powell@xxxxxxxxxxxx wrote:
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.
.
- References:
- Sort DataGridView
- From: joey . powell
- Sort DataGridView
- Prev by Date: Re: Convert String Value into XML
- Next by Date: Re: Creating *and HIDING* a keylogger
- Previous by thread: Sort DataGridView
- Next by thread: Re: Sort DataGridView
- Index(es):