How to set TGridLayout Height based off amount of items in grid - delphi

How does one set the height of A TGridLayout to be set based off the amount of items in the grid ? I have a grid with products in it which the user can purchase and need the grids height to be set based off the amount of buttons in the grid as there are times when there are less items in the same grid. From different providers.
I need the Grids height to fill up to the amount of buttons inside without cutting any buttons.

Related

How to scroll TFlowLayout content vertically?

I have a TFlowLayout containing 5 same-sized controls. The TFlowLayout (with Align=Top) is a child of TVertScrollBox. When making the flowlayout smaller all 5 controls are displayed as one column. This works fine. However, when these 5 controls don't fit within the view then I would expect TVertScrollBox to kick in and provide the vertical scrolling capability.
It turns out that the TFlowLayout.Height property is not adjusted to a new height that corresponds with the height of the 5 controls displayed in that one column.
What would be the best way to provide vertical scrolling in this case?

How to make table view horizontally engage full width

I'm developing an ios application which has a table view. when there is a long value in table cell, table column width size should be increase. I've develop a custom UI for this requirement as following images.
I have change the content size using following code, but it isn't increase
the table body size. you can see it in following image.
self.resultTableView.contentSize.width = self.cellWidth!
You can see the first image its appear as it is and when there is more indexes (columns) and user try to scroll horizontally towards right(as shown in second image), table view will not expand more than the viewport size.
How can I do table view fit to the scroll size?
and finally everything become invisible.
feel free to ask anything if you dont clear enough the quection.
I guess what you have to do is dynamically calculate the desired width and then set the tableView width (for example with a tableView.widtAnchor) to exactly this width.
For a table that scrolls into both dimensions, this could also be helpful:
http://www.brightec.co.uk/ideas/uicollectionview-using-horizontal-and-vertical-scrolling-sticky-rows-and-columns

How do i make a table of unknown number of rows and columns in a UITableViewCell

How do i create a table of unknown number of rows and columns in my UITableViewCell ? I am creating a survey application and the reporting can contain matrix type questions aswell. How do i view those in my TableViewCell. if the number of rows and columns exceed, it should also use scrolling to display the content. below is the picture of how it looks like. also this app is for iPhone and iPad both so the answer should be kept in consideration of Auto Layouts.
EDIT
The red crosses should also be in my control as i need to display a tick where the user has ticked.
I inserted a UIScrollView in the TableView's Cell and created the rows and columns dynamically using for loops on the basis of the number of rows and columns. Created dynamic labels for columns and rows and imageViews for tick and crosses and kept on managing the size by using x and y and at the end set the scrollView's content according to x and y for the scrolling.

Contentflow: how to set fixed widths for flow non-image items

so I'm trying to use ContentFlow (http://www.jacksasylum.eu/ContentFlow/index.php) to display non-image content pulled from a database. I have each of the ContentFlow items loading database content via AJAX, however, I would like to customize it so that the items have a fixed width.
eg. I watch to display 5 items in the coverflow. I want the center/primary item to be the largest in size (about 700px by 500px)
then I would like to the adjacent items about 100px and 70px wide respectively.
From what I've seen with the code, the ContentFlow width adjusts according to the browser width.
Is there a way to fix the item widths depending on which position they're in?
thanks

How to auto-size a DevExpress TcxGrid

I've created a table from a TcxGrid with a simple table view. The data is being poked into the table using DataController.Values[n,m] as a simple string and I have some 10 columns that will show various string widths.
The problem that I'm having is getting a table that has a horizontal scroll bar AND has auto-sized its columns. If I set CellAutoWidth true this fits all columns into the display width (with no scroll bar) but if I set it false, I get a scroll bar but columns of my default width and my data strings are truncated.
Could some kind person tell me how to get a horizontal scroll bar AND get each column to adjust its width to fit its max data width please?
Thanks
Brian.
Maybe it's enough to call YourGridView.ApplyBestFit instead of using CellAutoWidth.
You need to set columns BestFitMaxWidth and MinWidth property and make sure you have the width of the Datasets TField also set (if you are using DataSets).
Then, you can call YourGridView.ApplyBestFit;

Resources