HighTechTalks DotNet Forums  

DataGrid's Delete command does not work

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss DataGrid's Delete command does not work in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
alee via DotNetMonster.com
 
Posts: n/a

Default DataGrid's Delete command does not work - 02-19-2007 , 03:36 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/For...agrid/200702/1


Reply With Quote
  #2  
Old   
alee via DotNetMonster.com
 
Posts: n/a

Default Re: DataGrid's Delete command does not work - 02-19-2007 , 03:58 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.

alee wrote:
Quote:
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/For...agrid/200702/1



Reply With Quote
  #3  
Old   
alee via DotNetMonster.com
 
Posts: n/a

Default Re: DataGrid's Delete command does not work - 02-20-2007 , 03:05 PM



Hello,

I solved this problem by assigning DataKeyNames to the control.

Cheers,

Alan L.


alee wrote:
Quote:
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.

Hello,

[quoted text clipped - 11 lines]

Alan L.
--
Message posted via http://www.dotnetmonster.com



Reply With Quote
  #4  
Old   
Pak Lui
 
Posts: n/a

Default Re: DataGrid's Delete command does not work - 03-11-2007 , 01:53 AM



Normally, when the update & delete event doesn't work, first thing you
should do is to look for the datakey for the gridview



"alee via DotNetMonster.com" <u31808@uwe> wrote

Quote:
Hello,

I solved this problem by assigning DataKeyNames to the control.

Cheers,

Alan L.


alee wrote:
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.

Hello,

[quoted text clipped - 11 lines]

Alan L.

--
Message posted via http://www.dotnetmonster.com




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.