RishiKumar2210
Active Member
I need to resize the height of cell column of b4x table according to content inside the cell column. Is this Possible?
Sorry, I need to resize the particular row's column in particular row according to content inside the cell.I need to resize the height of cell column of b4x table according to content inside the cell column. Is this Possible?
Sorry, I need to resize the height of particular column. But The above link use to resize the width of particular columnThe solution is just below
[B4X] B4XTable - Resize columns based on content
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)...www.b4x.com
If I use B4XTable.RowHeight = yourValue.dip it resize all rows heights. But I need to resize a particular row according to content inside the column.Houps!
1 : Use measureMultilineTextheight from stringUtils library
2 : B4XTable.RowHeight = yourValue.dip - Set it before adding the data.
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 need to resize a particular row according to content inside the column.
What Changes I need to made in my code or is this impossible?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 tried for quite a while unsuccessfully
But How do I modify the library code?It is not possible to modify a particular line.
You would have to modify the library code.
Rename B4XTable.b4xlib to .zip.But How do I modify the library code?
I rename and changed to B4xtable.bas.. But Which Line I need to edit?Rename B4XTable.b4xlib to .zip.
Unzip. Edit the .bas file
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)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
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 B4XTableColumnI have b4x table with 5 columns and I have nearly 1000 rows. I have a column called "Company Name
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
I Tried this But the Text has not fit to the column. Some texts are hidden inside the columns.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
View attachment 146397B4X: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