P
Piotr Olech
I add record to DataTable in DataSet. I have a grid attached to that DT. I
want the grid to position to the newly added record, even if the contents of
grit is sorted or filtered.
As I can understand, grid is based on DataView of DT (especially on
DefaultView)?
So all I need is to know what is the position of that new row in current DV.
I could then set:
((CurrencyManager) this.BindingContext[DS, DT.TableName]).Position =
PositionOfNewRow
That should be enough.
Am I right? Then how can I obtain PositionOfNewRow?
I can't use any method based on Primary key, because I try to write a base
class in which I don't know exact names of tables, fields, keys etc.
Any ideas?
Or, may be, there are better ways to get what I want?
Regards
want the grid to position to the newly added record, even if the contents of
grit is sorted or filtered.
As I can understand, grid is based on DataView of DT (especially on
DefaultView)?
So all I need is to know what is the position of that new row in current DV.
I could then set:
((CurrencyManager) this.BindingContext[DS, DT.TableName]).Position =
PositionOfNewRow
That should be enough.
Am I right? Then how can I obtain PositionOfNewRow?
I can't use any method based on Primary key, because I try to write a base
class in which I don't know exact names of tables, fields, keys etc.
Any ideas?
Or, may be, there are better ways to get what I want?
Regards