database - How to determine value of DbGrid cell during OnMouseMove event -


I have an on-house main event, during which I want to get the value of some cells (not underneath the mouse) . In fact, the question is how can the cell be used, using the X and Y coordinates without the selection, changing the focus etc?

Toffig, you can use the MouseCoord process to get the current row and call To show the value of the status [Col., line] , you must set the value to the value of the property and create a new class descendant to use the protected property.

Check this code

  type THackGrid = class (TCustomDBGrid); // Create a new class to access the protected property process TForm1.DBGrid1MouseMove (Sender: Tubect; ​​shift: TIFFTTSTATE; x, y: integer); Var Cell: Tigrid Coord; Line, col: integer; OrigActiveRecord: integer; inherited from; Cell: = DBGrid1.MouseCoord (X, Y); Colonel: = Cell. X; Line: = cell why; If DGITITALS in DBibrite 1 Option then dec (line); // If the headings are shown adjust the Row Index (-1); If DGIdactor in DB Grid 1 The alternative is then December (Colonel); // If the pointer is shown, adjust the column index (-1); If Thakgid (DBGrid1) .DataLink Active and starts (Row> = 0) and (Colonel> = 0), then the Oriental Record starts: = Hagrid (DBEGEED1) .DataLink.ActiveRecord; // Try to save the original index THACKGrid (DBGrid1) .DataLink.ActiveRecord: = Row; Label1.Caption: = DBGrid1.Columns [Col.] .Field.AsString; // Show the current value in Half Grid (DBigrid 1) at the end of a televac DataLink Activivorld: = Objective record; // index ending the end; End; End;  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -