How do I draw a box around DBGrid row

Is there a way to draw a box around a row in a DBGrid as I drag an object over it? If I could get a canvas that represents the row I could do it, but I can't find a way to get the canvas of the row under the mouse. I can get the cell, but not the entire row.

Any ideas?

Comments

  • : Is there a way to draw a box around a row in a DBGrid as I drag an object over it? If I could get a canvas that represents the row I could do it, but I can't find a way to get the canvas of the row under the mouse. I can get the cell, but not the entire row.
    :
    : Any ideas?
    :
    :
    I think the entire row is simply a TRect with the following coordinates (0, Y_Cell_1, DBGrid.Width-1, Y_Cell_2), where Y_Cell_X are the top and bottom coordinates of the cell rect. I'm not sure about it, but its worth a try I think.
  • Thanks but it isn't going to work. It turns out that I can't get the rect coords of the call. There is a CellRect method of TCustomeGrid I thought I could use and there is a BoxRect that give the coords of a group of calls. As it turns out these methods are not available in TDBGrid.

    One more problem I discovered. There is no way to relate a row on the screen (in the grid) to the underlying record of the table. Without that info the entire drag and drop operation is worthless. I need to either find a new DBGrid componant that offers the methods I need or create one of my own. I would rather buy one because it would save me a lot of time I dont have.

    : : Is there a way to draw a box around a row in a DBGrid as I drag an object over it? If I could get a canvas that represents the row I could do it, but I can't find a way to get the canvas of the row under the mouse. I can get the cell, but not the entire row.
    : :
    : : Any ideas?
    : :
    : :
    : I think the entire row is simply a TRect with the following coordinates (0, Y_Cell_1, DBGrid.Width-1, Y_Cell_2), where Y_Cell_X are the top and bottom coordinates of the cell rect. I'm not sure about it, but its worth a try I think.
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories