Hi
I'm making a windows app which displays a datagrid. This datagrid has a dataset as its datasource. So far quite simple.
My problem is I don't know how to get a reference to the 'current' datarow from the datagrid. I can get the CurrentRowIndex, but this does not necesarrily correspond to the index in the dataset, because rows can have been deleted, or the datagrid might be sorted etc.
I'm thinking I can extract an id from the datagrid row, and find the corresponding row in the dataset. But to me this seems to be a sort of roundabout way of doing it. Is there really no better way to do it?
I've been looking at the BindingContext, but so far haven't been able to come up with anything good.
I hope someone can help me with this annoying problem!
Martin N Jensen
I'm making a windows app which displays a datagrid. This datagrid has a dataset as its datasource. So far quite simple.
My problem is I don't know how to get a reference to the 'current' datarow from the datagrid. I can get the CurrentRowIndex, but this does not necesarrily correspond to the index in the dataset, because rows can have been deleted, or the datagrid might be sorted etc.
I'm thinking I can extract an id from the datagrid row, and find the corresponding row in the dataset. But to me this seems to be a sort of roundabout way of doing it. Is there really no better way to do it?
I've been looking at the BindingContext, but so far haven't been able to come up with anything good.
I hope someone can help me with this annoying problem!
Martin N Jensen