Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 08-21-2008, 09:57 PM
megamanx megamanx is offline
Member
 
Join Date: Jun 2007
Posts: 33
Default Anyone uses TMS dbgrid?

Anyone could tell me how to delete the selected rows(multi/disjunct select enabled)?It seems i am doing everything ok, but......does not work.
Reply With Quote
  #2  
Old 08-21-2008, 11:14 PM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,333
Default RE: Anyone uses TMS dbgrid?

If you're doing everything ok, where's the code you delete your rows with???

Objective reality is a delirium caused by lack of alcohol in blood.
There is no place like 127.0.0.1
Reply With Quote
  #3  
Old 08-21-2008, 11:46 PM
megamanx megamanx is offline
Member
 
Join Date: Jun 2007
Posts: 33
Default RE: Anyone uses TMS dbgrid?

i've tried some variations and deleted them all, it only worked if i do the selection via code like this below, but that's not what i want, i want to select with the mouse!


For i := 1 To Grid.RowCount - 1 Do Begin
Grid.RowSelect[i] := True;
End;
Grid.RemoveSelectedRows;

Actually it seems that it should work with this line of code only:

Grid.RemoveSelectedRows;

It is "working" but it is not deleting the selected rows most of the time.It is deleting random rows.
Reply With Quote
  #4  
Old 08-22-2008, 12:34 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,333
Default RE: Anyone uses TMS dbgrid?

It's a dbgrid, so you should update your datasource, not the grid...

Objective reality is a delirium caused by lack of alcohol in blood.
There is no place like 127.0.0.1
Reply With Quote
  #5  
Old 08-22-2008, 12:39 AM
megamanx megamanx is offline
Member
 
Join Date: Jun 2007
Posts: 33
Default RE: Anyone uses TMS dbgrid?

The idea was to delete from the grid and then update the datasource thru' the clientdataset, i don't know the other way around , if you know tell me.

I can get the integer index of the selected rows, but don't know what to do with that.
Reply With Quote
  #6  
Old 08-22-2008, 01:37 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,333
Default RE: Anyone uses TMS dbgrid?

That's the basics of database programming. The dbgrid shows from the datasource, so if you want to delete you delete from the datasource and then the dbgrid will automatically synchronize...

read more on database programming on delphi.about

Objective reality is a delirium caused by lack of alcohol in blood.
There is no place like 127.0.0.1
Reply With Quote
  #7  
Old 08-22-2008, 02:19 AM
megamanx megamanx is offline
Member
 
Join Date: Jun 2007
Posts: 33
Default RE: Anyone uses TMS dbgrid?

I know it all , but for multiple records whatever you know is not applicable for this grid, i can't even get a bookmark.
Reply With Quote
  #8  
Old 08-22-2008, 05:41 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,333
Default RE: Anyone uses TMS dbgrid?

BookMark isn't part of a grid, it's part of a dataset...
So it still has nothing to do with the grid?

Objective reality is a delirium caused by lack of alcohol in blood.
There is no place like 127.0.0.1
Reply With Quote
  #9  
Old 08-22-2008, 06:03 AM
mshkolnik mshkolnik is offline
Senior Member
 
Join Date: Jul 2001
Posts: 4,195
Default RE: Anyone uses TMS dbgrid?

yourGrid.SelectedRows.Delete

With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
  #10  
Old 08-22-2008, 12:07 PM
megamanx megamanx is offline
Member
 
Join Date: Jun 2007
Posts: 33
Default RE: Anyone uses TMS dbgrid?

With a Delphi grid and any decent grid you can get the bookmark by type casting the integer index of grid's row to Pointer.Their support answered me after a long wait, the answer is that it is not possible except if i use their "hotmail" style selection(the mouse one is decorative??), but that's all bugged, i gave up.
Reply With Quote
Reply

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 Off

Forum Jump


All times are GMT. The time now is 08:06 AM.


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