Board index » delphi » DBGrid: Deleting a Selected Row.

DBGrid: Deleting a Selected Row.

A newbie question, I suspect.

Im using a dbgrid fed by a simple in-memory table,
with Delphi 3.02 pro and tmemdataset, a 3d party component
since I don't have tClientDataset.

I want to delete the dataset row selected from the dbgrid
and I cannot figure out how to make the current record in
the dataset match the selected row in the grid, without
stepping through the whole dataset, looking for a match.
Is there a more elegant way to do this?

Thanks,
Mark Leymaster

 

Re:DBGrid: Deleting a Selected Row.


The selected row *is* the current record.

Paul / ColumbuSoft
www.columbusoft.com

Quote
Mark Leymaster <MarcP...@Ziplink.Net> wrote in message

news:393FC793.57FE99B9@Ziplink.Net...
Quote
> A newbie question, I suspect.

> Im using a dbgrid fed by a simple in-memory table,
> with Delphi 3.02 pro and tmemdataset, a 3d party component
> since I don't have tClientDataset.

> I want to delete the dataset row selected from the dbgrid
> and I cannot figure out how to make the current record in
> the dataset match the selected row in the grid, without
> stepping through the whole dataset, looking for a match.

> Is there a more elegant way to do this?

> Thanks,
> Mark Leymaster

Re:DBGrid: Deleting a Selected Row.


The selected row is the current record. Just call DataSet.Delete to delete
it.

--
Bill Todd (TeamB)
(Questions received via email cannot be answered.)

Other Threads