Groups | Blog | Home
all groups > asp.net datagrid control > february 2007 >

asp.net datagrid control : DataGrid's Delete command does not work


alee via DotNetMonster.com
2/19/2007 8:36:01 PM
Hello,

I defined an object source with GetData(), Insert(Object object), Update
(Object object),
Delete(Object object). When I connected the datasource to a DataGrid View
and
a Details View, ASP.NET worked well for all other commands except "Delete".

There is no response by either clicking the DataGrid's view Delete command or

the Details View's Delete command. Everything else seems to be working fine.

Any suggestions will be greatly appreciated.

Alan L.

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net-datagrid/200702/1
alee via DotNetMonster.com
2/19/2007 8:58:43 PM
Hello,

The DataGrid View and Details View commands now generated an error message
inside the Delete(Object object)"

THERE IS NO ROW AT POSITION 0.

Line 139: DockandSlipDS.DockTableRow row =
Line 140: (DockandSlipDS.DockTableRow)
Line 141: _dockTA.GetDataByDockID(dock.DockID).
Rows[0];

It appears that ASP.NET 2.0 sent an empty record to the Delete Command.

Anyone can give me hint about making ASP.NET send the right information to
the Delete method?

Thanks,

Alan L.

[quoted text, click to view]

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net-datagrid/200702/1
alee via DotNetMonster.com
2/20/2007 8:05:59 PM
Hello,

I solved this problem by assigning DataKeyNames to the control.

Cheers,

Alan L.


[quoted text, click to view]

--
Message posted via http://www.dotnetmonster.com
Pak Lui
3/11/2007 1:53:27 AM
Normally, when the update & delete event doesn't work, first thing you
should do is to look for the datakey for the gridview



[quoted text, click to view]

AddThis Social Bookmark Button