|
-
Apr 10th, 2003, 10:35 AM
#1
Thread Starter
New Member
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
Last edited by onis; Apr 11th, 2003 at 06:23 AM.
-
Apr 10th, 2003, 12:05 PM
#2
how about try
dataset1.Tables("Avsyning").Rows(datagrid.currentrowIndex).Delete
Perhaps?
-
Apr 10th, 2003, 07:56 PM
#3
Lively Member
VB Code:
Me.BindingContext(DataSet, "Table").RemoveAt(Me.BindingContext(DataSet, "Table").Position)
-
Apr 11th, 2003, 06:24 AM
#4
Thread Starter
New Member
Thanks alot
Execellent! it worked as planned now.
Thanks chinhow !
thanks to Cander too for taking your time =)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|