Accecing a row in a dataset through a datagrid[RESOLVED]
Hi, I posted this early on the wrong forum, so....
Ok here we go:
I have this xml (shortned)
<Avsyning>
<model>Membran</model>
<length>0</length>
<ANGLE>
<Pos>44</Pos>
<Neg>22</Neg>
</ANGLE>
</Avsyning>
This is read to bounded to a datagrid with
datagrid1.SetDataBinding(dSet, "avsyning")
No dataview is used (should I?)
Now I want to (in run time) delete a row in the dataset.
dataset1.Tables("Avsyning").Rows.RemoveAt(datagrid.currentrowIndex)
This will delete the wrong row if i sort the datagrid1. The rowIndex is the current row in the datagrid, but to get the row in the dataset what todo? I think a have a solution but it only works if the user don't navigate down to a child (datagrid.currentRowIndex has the value of the index for the parent row... Not the child row. Feels realy strange to me!).
Thanks for (any) help!
edit: Tried to explane some more