Forum > Databases

How can get scroll position of DBGrid ?

(1/7) > >>

majid.ebru:
Hi
i put a DBGrid in form and it has Verticalscrol and HorizentalScroll.
how can i get postion of Scroll's DBGrid??

Handoko:
As far as I know, we cannot access the positions of DBGrid's scrollbars. Why do you need the values? Can you please explain more.

Alternatively, both TStringGrid and TDrawGrid have TopRow to get the first row that showing on the grid.

It may not the best thing to do but if you 'really' need to get the vertical scrollbar position, you can try to replace TDBGrid with TStringGrid. The downside is, you have to provide the code manually to load data from database to TStringGrid and that is not easy.

majid.ebru:
Thank you

i put a scrollbox on top of DBGrid and put it some editbox.
i want to  search text in each colume.
but if i move verticalscroll of dbgrid , i can't move verticalscrollbox becuase i haven't verticalscroll position of DBgrid.
.
so i should an other way to search each colum. :-X

Handoko:
Did you mean you put a TScrollBox on the TDBGrid? You cannot use TScrollBox to scroll the things inside TDBGrid.

What did  you want to do? Do you want to do item searching for the database? User type something in a TEdit and the result will be shown in a grid?

majid.ebru:

--- Quote from: Handoko on June 12, 2017, 02:30:07 pm ---Did you mean you put a TScrollBox on the TDBGrid? You cannot use TScrollBox to scroll the things inside TDBGrid.

--- End quote ---
No.i can't put a TScrollBox on the TDBGrid

--- Quote from: Handoko on June 12, 2017, 02:30:07 pm --- Do you want to do item searching for the database? User type something in a TEdit and the result will be shown in a grid?

--- End quote ---
YES

Navigation

[0] Message Index

[#] Next page

Go to full version