Is there an easy way to allow only one row to open and automatically close all other open rows?
Sub clv1_ItemClick (index As Int, Value As Object)
If Not(Currindex = index) Then
Dim i As ExpandableItemData = clv1.GetValue(Currindex)
If i.Expanded = True Then
expandable.ToggleItem(Currindex)
End If
End If
Sleep(300)
expandable.ToggleItem(index)
Currindex = index
End Sub
Do you mean for instance if the list has 5 items for a given panel, you want to show only the first one in the list and not show the other 4 when you expand the panel. . Can you explain better what you want.Is there an easy way to allow only one row to open and automatically close all other open rows?
Sub clv1_ItemClick (index As Int, Value As Object)
If Not(Currindex = index) Then
expandable.CollapseItem(Currindex)
Currindex = index
End If
Sleep(300)
expandable.ToggleItem(index)
End Sub
Sub clv1_ItemClick (index As Int, Value As Object)
If Not(Currindex = index) Then
Dim i As ExpandableItemData = clv1.GetValue(Currindex)
If i.Expanded = True Then
expandable.ToggleItem(Currindex)
End If
End If
Sleep(300)
expandable.ToggleItem(index)
Currindex = index
End Sub
clv1.AnimationDuration = 200
CLVExpandable1.Initialize(clv1)
Sub clv1_ItemClick (index As Int, Value As Object)
If Not(Currindex = index) Then
Dim i As ExpandableItemData = clv1.GetValue(Currindex)
If i.Expanded = True Then
CLVExpandable1.ToggleItem(Currindex)
End If
End If
Sleep(clv1.AnimationDuration) 'Animation to match expandable effects
CLVExpandable1.ToggleItem(index)
Currindex = index
End Sub
It's clear.
yesIs it possible to search through the headings of a long (about 10,000 rows) list and move to the found row when the data is not loaded all at once?
The last lines in the list are not fully visible when expanded. I would like to have automatic scrolling if substrings are not visible.I am making some adjustments to the class.
see:The last lines in the list are not fully visible when expanded. I would like to have automatic scrolling if substrings are not visible.
Public Sub ExpandItem (index As Int)
Dim item As CLVItem = mCLV.GetRawListItem(index)
Dim currentOffset As Int = mCLV.sv.ScrollViewOffsetY
Dim id As ExpandableItemData = item.Value
Dim itemBottom As Int = item.Offset + id.ExpandedHeight
ResizeItem(index, False)
Dim delta As Int = itemBottom - currentOffset - mCLV.AsView.Height
If delta > 0 Then
Sleep(5)
Dim offset As Int = itemBottom - mCLV.AsView.Height
#if B4i
Dim nsv As ScrollView = mCLV.sv
nsv.ScrollTo(0, offset, True)
#else if B4J
Sleep(50)
mCLV.sv.ScrollViewOffsetY = offset
#Else If B4A
Dim nsv As ScrollView = mCLV.sv
nsv.ScrollPosition = offset
#End If
End If
End Sub
изменять:
Made a project with lazy loading 10000 records based on your solution. The search will be carried out by the index of the line. There are a couple of questions left that, in my opinion, should not be posted in a new thread, since the CLVExpandable class has been changed.change:
Questions:
1. How to open an expanding list at the desired index?
2. Is it possible to apply a ListView with any number of rows so that all of them are visible in the drop-down list?