tdbgrid

TDBGrid onSelect

Hi,I would like to customize TDBGrid: 1) add onSelect/onUnselect events - e.g. good for show count of selected items. 2) remove select item on left mouse click. I have inherited TDBGrid and rewritten MouseDown, but then it is not possible to move or resize columns :( So, how to do it? D2009 ...

Finding the current row in Delphi's TDBGrid

Is there a way of finding out which row is current in a TDBGrid? ...

How to get selected cells from TDBGrid in Delphi 5

I have a DBGrid on a form and I have made multiple selections, I now need to send the selected cells (they are email addresses) to the "TO Box" of Outlook how can I do this, I will appreciate any help ( Delphi5) Thanks in advance ...

free pascal, tdbgrid, get current row

Hi all! I'm new to free pascal and lazarus stuff and i wonder how can i get row data (for example id column) from selected row in tbgrid? ...

Restore horizontal scroll position in TDBGrid

I wrote a simple method to sort column in TDBGrid. If Option.RowSelect set to False everything works fine, but if RowSelect gets True the horizontal position scroll doesn't restore after sort column. So I try GetScrollPos and SetScrollPos to restore horizontal Scroll position, the ScrollBar goes to the right position but TDBGrid didn't s...

Moving Columns in a DBGrid seems to move the attached DataSet fields

I observed something last week that I did not expect, and will describe below. I am curious as to why this happens. Is it something internal to the TDataSet class, an artifact of the TDBGrid, or something else? The order of the fields in an open ClientDataSet changed. Specifically, I created a ClientDataSet in code by calling CreateData...

How do I make a TDBGrid's columns fit the grid's width?

I've got a TDBGrid with predefined columns, and I just can't get the width right. I can mess with the Width property of the columns in the Form Designer and get the width to look just right at design time, but at runtime, for whatever reason, the columns tend to be significantly wider, and I end up with a scroll bar at the bottom of the...

ReadOnly TDBGrid/TwwDBGrid Cell in Delphi?

Hi, is it possible to set a TDBGrid (or TwwDBGrid) cell ReadOnly in Delphi? Currently I am fiddling around with literally greying the cell and clearing it after an edit, but it's not very satisfactory. Cheers, Jamie ...

Delphi - Using DBGrid to select rows from a search

I have searched a database using a query. The results of the search are displayed in a DBGrid component for the user to select the row s/he wishes to proceed with. DBGrid always sets the record pointer to the first record in the results set, so a row is always "selected" by default. I need to change this behaviour to no row being...