There is a my vcl application. In form, there is a StringGrid. I want to set column header height but I dont know that how it do.
So the questions is: how to set StringGrid column header auto row height because column row width is not certain
There is no real column header in a TStringGrid, just a amount of fixed rows (default 1).
Just set the height for the row you want with the indexed property TStringGrid.RowHeights
StringGrid1.RowHeights[0] := 42; // set first row height
Related
I am using a Vaadin Grid and in a column header I put a TextField filter field to filter the content. The header row is created using grid.appendHeaderRow() and the TextField is added to the header row as follows:
filteringHeader = grid.appendHeaderRow();
filteringHeader.getCell(column).setComponent(filterTextField);
The column itself has been set to autosize and to have no flexgrow
column.setAutoWidth(true).setFlexGrow(0);
Without the filterHeader the column automatically sizes the width to the content in the column, but with the filterHeader the column width expands to the default width of a TextField. Setting the width of the TextField to 100% allows it to expand to the width of the column, but it can never be narrower than the default TextField width.
My question is how do I set the TextField to be the same size as the autosized column, even for cases where the content is narrower than the default FextField width, and where I do not know the minimum width in px?
This is simple, I know, but...have you tried setting the max width of the text field?
I have a table view cell which has three elements vertically
a title label
a text box
a validation label
I want to show validation label only when it fails.
If I just hide the validation label then the space occupied by the label is stil there and it looks awkward having more distance between the next row
so what would be the best approach to handle the scenario
Change the table-row height whenever validation label's hidden status changes
I think this approach probably will not work because label is still there in the tableview cell so the tableview cell will readjust itself to have the label height there irrespetive of whether it appears or not
Change the label height constraint constant and tablerow height whenever there is change in label's hidden status
so basically if I want to hide it then I will be setting the label's heigh to zero and readjust the tablerow height ... it'll work but there is a problem..
If I set label number of lines zero then depending on the content label will change its content height .... but as I am using constraint for height... I will be hardcoding the height and it can lead to problem again.
Basicallyy my need is I have one label and text box whose height is fixed and I have a one more label ... this could be hidden sometimes and this could be one line or 4 lines
I want the row height to adjust according to that(0 lines(hidden),1/2/3 line label visible)
sometime even the first label that I was talking it could go to the next line in smaller devices like iphone 4s
so somebody help me out on the issue
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.
I'm having a UITableViewController with two sections. Section 0 always contains 1 row with height 22px. I'm setting this with heightForRowAtIndexPath... Section 1 contains 0-n rows with height 44px. I'm also setting the height of these with heightForRowAtIndexPath.
The problem is that when I have no rows in section 1, all the "fill out cells" will have height 22px, like the cell in section 0, instead of 44px as I would like them to be.
Is it possible to set the height of these fill out cells to 44px (the cells that are empty and added automatically to fill out the table view) even if I only have the one row that is 22px?
Here is what I get (to the left) and what I want (to the right):
Instead of making your "status bar" its own section, you could make it a header view for section 1.
Try editing the UITableView attributes in the XIB - you can set a default row height so that if otherwise stated, all these "fill out" cells are defaulted to 44px height. You say that the 22px cell is there anyway so I think it should do as a solution to your problem.
I'm having the same problem here. Two sections, the first shows 3 cells with a smaller height and always with the same content and they should scroll with the table so they can't be a header. The rows below with a larger cell height are changing so sometimes there are none.
I adjusted the cell height of the tableView as well as for the prototype cells and assign the heightForRowAtIndexPath value properly, but this doesn't help. Somehow the tableView seems to repeat the cells from first section into the second one if there are no cells in the later.
Only solution so far seems to be the creation of an empty cell in the second section. That's just more complicated if you are using animated cells.
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;