Addo Well-Known Member Licensed User Longtime User Apr 29, 2018 #1 i am creating items like following Code: Copy Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel Dim p As Panel p.Initialize("") p.SetLayout(0, 0, Width, Height) p.LoadLayout("cellitem") label1.Text = " Name " labelnumber.Text = "100 " Return p End Sub i am trying to set some items visible to False how can i do that programmatically based on items index ?
i am creating items like following Code: Copy Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel Dim p As Panel p.Initialize("") p.SetLayout(0, 0, Width, Height) p.LoadLayout("cellitem") label1.Text = " Name " labelnumber.Text = "100 " Return p End Sub i am trying to set some items visible to False how can i do that programmatically based on items index ?
LucaMs Expert Licensed User Longtime User Apr 29, 2018 #2 I guess you want to hide an item reducing its height to zero. You should use: https://www.b4x.com/android/forum/threads/b4x-xui-expandable-list-based-on-xcustomlistview.86449/ P.S. no, it is not enough, you should modify it as you should with xCustomListView. Trying... Upvote 0
I guess you want to hide an item reducing its height to zero. You should use: https://www.b4x.com/android/forum/threads/b4x-xui-expandable-list-based-on-xcustomlistview.86449/ P.S. no, it is not enough, you should modify it as you should with xCustomListView. Trying...
Addo Well-Known Member Licensed User Longtime User Apr 29, 2018 #3 i tried Code: Copy xclv.GetPanel(1).Visible = False with Code: Copy xclv.AddTextItem("item1", "item1") xclv.AddTextItem("item2", "item2") the text hidden but the item itself still visible Upvote 0
i tried Code: Copy xclv.GetPanel(1).Visible = False with Code: Copy xclv.AddTextItem("item1", "item1") xclv.AddTextItem("item2", "item2") the text hidden but the item itself still visible
LucaMs Expert Licensed User Longtime User Apr 29, 2018 #4 It's not so easy; I have to do other things now, but the way is to create a HideItem routine, based on RemoveAt (copying RemoveAt and modifiyng its code) Upvote 0
It's not so easy; I have to do other things now, but the way is to create a HideItem routine, based on RemoveAt (copying RemoveAt and modifiyng its code)
Erel B4X founder Staff member Licensed User Longtime User Apr 29, 2018 #5 The expandable version is not relevant here. You can call RemoveAt to remove an item and later add it back with InsertAt. Upvote 0
The expandable version is not relevant here. You can call RemoveAt to remove an item and later add it back with InsertAt.
LucaMs Expert Licensed User Longtime User Apr 29, 2018 #6 Erel said: You can call RemoveAt to remove an item and later add it back with InsertAt. Click to expand... This the "most quick way", of course (you have to store the item and its index, in a "List of type tXXXItem). A better solution would be to add a method like SetItemVisibility(Visible As Boolean). The tag property is already used; maybe we can create an internal type, to store the Index and Visible. Then the ItemVisibility routine should be very similar to RemovaAt. I know, it's a "lot" of work. Upvote 0
Erel said: You can call RemoveAt to remove an item and later add it back with InsertAt. Click to expand... This the "most quick way", of course (you have to store the item and its index, in a "List of type tXXXItem). A better solution would be to add a method like SetItemVisibility(Visible As Boolean). The tag property is already used; maybe we can create an internal type, to store the Index and Visible. Then the ItemVisibility routine should be very similar to RemovaAt. I know, it's a "lot" of work.
LucaMs Expert Licensed User Longtime User Apr 29, 2018 #7 New thread? Please, no Property (at least read-only) for DividerSize. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Apr 29, 2018 #8 LucaMs said: Property (at least read-only) for DividerSize. Click to expand... LucaMs said: New thread? Please, no Click to expand... Of course... Upvote 0
LucaMs said: Property (at least read-only) for DividerSize. Click to expand... LucaMs said: New thread? Please, no Click to expand... Of course...
LucaMs Expert Licensed User Longtime User Apr 29, 2018 #9 Erel said: Of course... Click to expand... Upvote 0