Page 1 of 1

Resize input fields with DBPro grid

PostPosted: Sun Jan 05, 2014 12:26 pm
by ebear
Hello All,

I have above my DBPro grid (see images) for each column a search field after the user makes a search input in one or more input fields and presses "Enter"
a T-SQL script starts and returns the records found. This all is working fine.

Now when I have in the Grid properties "Allow Column resize" I like to have also the input fields resized in the same width as the grid columns.
Has anyone an Idea to do this in a smooth way?

Thanks a lot for your reactions.

Eric

Before resizing:
Image

After resizing:

Image

Re: Resize input fields with DBPro grid

PostPosted: Sun Jan 05, 2014 1:20 pm
by mishem
dbpGetGridClientInfo
dbpGetColumnWidths
dbpSetColumnWidths
SizeObject


????

Re: Resize input fields with DBPro grid

PostPosted: Sun Jan 05, 2014 1:35 pm
by Gaev
Eric:

You can use dbpGetColumnWidths (and a bit of parsing of the returned values) to get the column widths of the desired fields.

However, there is no event trigger in response to a user making a column width adjustment ... so ...

- one option would be to run a Timer object that compares the two widths and makes the necessary adjustments to the input fields

- or give the user the ability to request the same ... either via a separate Button or (if you are not using it for other purposes) via a double click anywhere in the Grid