Hi,
i use Ultra Grid to load my data, after binding the grid to datatable, i add a image to one of the column.
when the grid shows in the form it is shown with the pensil mark in each row, this gives a meaning that every row is selected.
Please let me know how to remove thsi pensil mark that is the edit mark.
Correction in my question.
i use Ultra Grid to load my data, after binding the datatable to grid, i add a image to one of the column in ultragrid.
when the grid shows in the form it is shown with the pensil mark in each row, this gives a meaning that every row is EDITED.
Hi Sailash,
The pencil icon is an indicator that one or more cell values have been modified in the row. You can call row.Update method to commit the modifications. There's also UpdateData method on the UltraGrid that will do it for all rows in the grid.
Sandip
Hi Raj,
Why is the pencil disappearing? That is not the default behavior. The pencil image appears when a row is made dirty by the user or in code. It does not disppear until the row is committed or cancelled. So something in your code must be committing or cancelling the changes on the row.
Thanks for the quick response Mike.
I have an event handler for AfterCellUpdate, where i do row validation with respect to the user changes. Is this causing this behavior? I do not explicitly update the row or do a updatedata. When user makes a change and moves out of the row (selects a different row), the pencil disappears on the row.
Thanks,
Raj
Oh, okay, you left out that that the user was moving to another row. There's no way to keep the row in edit mode once another row gets focus. The DotNet BindingManager implicitly calls an EndEdit once the position of the CurrencyManager is changed.
It looks like the grid.UpdateMode could be set to OnUpdate (instead of the OnRowChangeOrLostFocus default) to avoid an automatic AcceptChanges. That keeps the dirty marker on dirty rows until explicitly calling Update.
I have another question though.
I have a grid using a DataSet as the DataSource. Is there a way to prevent the grid from removing the rows that're slated for deletion (dataRow.RowState == Deleted). I tried changing the DataTable's DefaultView.RowStateFilter to Current | Deleted. But that doesn't seem to be making a difference.
--yale
Hi Yale,
yalewang said:It looks like the grid.UpdateMode could be set to OnUpdate (instead of the OnRowChangeOrLostFocus default) to avoid an automatic AcceptChanges. That keeps the dirty marker on dirty rows until explicitly calling Update.
I'm not sure this will work. See this thread: UltraGrid.UpdateMode and BindingList<T> data source - Infragistics Forums
yalewang said:I have a grid using a DataSet as the DataSource. Is there a way to prevent the grid from removing the rows that're slated for deletion (dataRow.RowState == Deleted). I tried changing the DataTable's DefaultView.RowStateFilter to Current | Deleted. But that doesn't seem to be making a difference.
I don't think so. The grid has no control over this, it just displays what the BindingManager gives it, and I suspect the IBindingList implementation on DataSet/DataTable is always going to filter out deleted rows.
You could, of course, bind the grid to a data source that still contains those rows. You could, for example, copy the data into another data table or an UltraDataSource.