Datagridview - Cascade Delete - Need a help

sameera207

New member
Joined
Nov 30, 2006
Messages
1
Programming Experience
1-3
Hi all,

I have a little problem of Cascade delete in DatagridView (vb.net Application).
I have a parent - child relationship and need to delete the parent row from the Parent Grid. (so far now its working :)) But the problem comes when i need to reflect the changes.
(basically i want to remove the deleted rows from both parent and child grids)

I'm using typed datasets in VB 2005
and i have set the cascade deletion in the relationship

below is my code

AUD_TBLTableAdapter - Parent table Adapter
AUD_FLDTableAdapter - Child table adapter
deleteRow(Convert.ToDecimal(1) - delete query in my datatable


Me.AUD_TBLTableAdapter.deleteRow(Convert.ToDecimal(1))
Me.Audit.AUD_TBL.AcceptChanges()
Me.AUD_TBLTableAdapter.ClearBeforeFill = False
Me.AUD_TBLTableAdapter.Fill(Me.Audit.AUD_TBL)
Me.AUD_FLDTableAdapter.Fill(Me.Audit.AUD_FLD)



with this was deletion is happaning..But grids are not refreshing :(

can anyone help..Please ;)

ThankX in adavance

Best regards
sameera
:confused:
 
to refresh the datagrid : datagridview1.refresh()

or try,
datagridview.datasource=nothing
datagridview.datasource=dataset
 
Back
Top