Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 12-01-2010, 08:15 PM
MrBaseball34 MrBaseball34 is offline
Senior Member
 
Join Date: Jan 2001
Posts: 7,260
Default SMDBgrid question

Anyone know how to iterate through the selected items in a SMDBGrid and delete them? I have eoCheckBoxSelect set to True.
__________________
MrBaseball34

Hook 'em Horns
2005 College Football National Champions
2005 College Baseball National Champions
  #2  
Old 12-02-2010, 02:54 PM
GeoWink GeoWink is offline
Senior Member
 
Join Date: Jan 2001
Posts: 882
Default

Would using a dbNavigator help with this?

George
  #3  
Old 12-02-2010, 05:55 PM
MrBaseball34 MrBaseball34 is offline
Senior Member
 
Join Date: Jan 2001
Posts: 7,260
Default

Are you nuts? dbNavigator went out with Delphi1. I don't know why they even keep it in there, it is pretty useless now days.
I solved the problem like this:
Code:
  for i := 0 to dbgInventory.SelectedRows.Count-1 do
  begin
    qryInventory.Bookmark := dbgInventory.SelectedRows.Items[i];
    inventory_id := qryInventory.FieldByName('inventory_id').AsInteger;
    qryInventory.Delete;
    // Now delete the pricing for that item
    qryDeletePricing.Params.ParamByName('inventory_id').AsInteger := inventory_id;
    qryDeletePricing.ExecSQL;
  end;
__________________
MrBaseball34

Hook 'em Horns
2005 College Football National Champions
2005 College Baseball National Champions
Closed Thread

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 11:44 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.