I have a UltraWinGrid bound to a model(which holds the dataset) , through a BindingSource. I have 2 buttons, 'Up' and 'Down' to move rows in the grid. I want to move those rows in the underlying table also, but by using RefreshBinding or events,smth like that, not by moving the rows by code and then rebind the grid to the table. Pleas help, I've tried everything and it just move the selection in the grid.
Hi,
Moving rows in the DataTable is not something that the grid can do - that would have to be done in code. I'm not aware of any methods on the DataTable which make this easy to do. My guess is that you would have to remove the row from the data table and then re-insert it at the correct point.
I tried this out and the grid seems to update with the new order just fine - as long as the grid is not sorted.
For example, if my grid is bound to a DataTable called dt1, this moves row 2 to the first position in the table.
DataRow row = this.dt1.Rows[2]; this.dt1.Rows.Remove(row); this.dt1.Rows.InsertAt(row, 0);
Hi Mike
I have a grid with paging enabled and i am moving the contents of grid to a temporary table
DataTable
();
dt.Columns.Add(
));
//DataRow row = dt.NewRow();
dgChoice.Rows)
{
row = dt.NewRow();
row[
].Value.ToString());
] = item.Index;
But only the rows of current page of the grid are getting copied not all the rows of the grid, is there any way by which i can copy all the rows of the grid to the temporary table?
Thanks
Yaju
Hi Yaju,
UltraWinGrid does not have any built-in support for paging. So I assume you are probably implementing it yourself by retrieving only the data for a single page at a time and binding that to the grid.
So the only way to get all of the rows would be to do it from your data source and get all the rows.