This code measures the required width based on the cells text and set it: Sub B4XTable1_DataUpdated Dim ShouldRefresh As Boolean 'NameColumn and NumberColumn are global B4XTableColumns that we want to measure For Each column As B4XTableColumn In Array(NameColumn, NumberColumn)...
This code measures the required width based on the cells text and set it: Sub B4XTable1_DataUpdated Dim ShouldRefresh As Boolean 'NameColumn and NumberColumn are global B4XTableColumns that we want to measure For Each column As B4XTableColumn In Array(NameColumn, NumberColumn)...
I do not think you can adjust the height of only one given row in the table. based on the B4XTable code. Maybe if you modify the code. I tried for quite a while unsuccessfully. However, if I am mistaken Erel will straighten us out.
I do not think you can adjust the height of only one given row in the table. based on the B4XTable code. Maybe if you modify the code. I tried for quite a while unsuccessfully. However, if I am mistaken Erel will straighten us out.
It is not one line that needs to be modified, but the entire code.
B4XTable is based on a CLV.
If you change the height of the lines in a CLV, all the lines will be increased. It is therefore not possible to modify the height of a single line.
There might be other alternatives, but we don't know what you want to do.
Explain your project a little and post the code that is causing you problems
It is not one line that needs to be modified, but the entire code.
B4XTable is based on a CLV.
If you change the height of the lines in a CLV, all the lines will be increased. It is therefore not possible to modify the height of a single line.
There might be other alternatives, but we don't know what you want to do.
Explain your project a little and post the code that is causing you problems
I have b4x table with 5 columns and I have nearly 1000 rows. I have a column called "Company Name". In this column I have a companyname morethan 300 characters. For Example SRE KAMAKCHI SILKS-T.KALLUPATTI ( Rec No : C/8 By Cash From SRE KAMAKCHI SILKS - T.KALLUPATTI)
So I have to resize the HEIGHT(Not Width) of column according to content in the column.
Here is one way you can approach it by reducing the font size when the textt length is above a certain number of characters (see screenshot): Please note that c1 is your column 'Company Name' and declared in Globals: Private c1 As B4XTableColumn
B4X:
Sub B4XTable1_DataUpdated
Dim f As B4XFont =B4XTable1.LabelsFont
For i = 0 To B4XTable1.VisibleRowIds.Size - 1
Dim p As B4XView = c1.CellsLayouts.Get(i+1)
Dim b4xlbl As B4XView= p.GetView(0)
If b4xlbl.Text.Length > 30 Then
b4xlbl.Font = xui.CreateDefaultFont(12) 'adjust your font accordingly
Else
b4xlbl.Font = f
End If
Next
End Sub
Here is one way you can approach it by reducing the font size when the textt length is above a certain number of characters (see screenshot): Please note that c1 is your column 'Company Name' and declared in Globals: Private c1 As B4XTableColumn
B4X:
Sub B4XTable1_DataUpdated
Dim f As B4XFont =B4XTable1.LabelsFont
For i = 0 To B4XTable1.VisibleRowIds.Size - 1
Dim p As B4XView = c1.CellsLayouts.Get(i+1)
Dim b4xlbl As B4XView= p.GetView(0)
If b4xlbl.Text.Length > 30 Then
b4xlbl.Font = xui.CreateDefaultFont(12) 'adjust your font accordingly
Else
b4xlbl.Font = f
End If
Next
End Sub