Z zombee81 Member Licensed User Longtime User Feb 18, 2014 #1 I've adapted the CreateListItem from the CustomListView demo, to add items to a custom list view using a loadlayout to add a predefined layout for each entry. Code: Copy Sub CreateReadingItem(dtDateTime As String, Reading As String) As Panel Dim p As Panel p.Initialize("") p.LoadLayout("ReadingItemLayout") Dim chkDateTime As CheckBox Dim lblReading As Label chkDateTime.Text = dtDateTime lblReading.Text = Reading Return p End Sub Then I'm temporarily adding data in the Activity_Create function, by using: Code: Copy ElectricityReadingsList.Add(CreateReadingItem("17/02/2014 - 10:15 PM", "005573.0"), 80dip, "") But I get Panel.LoadLayout should only be called after the panel was added to its parent. (warning #1001), can anyone suggest a way around this? Thanks in advance.
I've adapted the CreateListItem from the CustomListView demo, to add items to a custom list view using a loadlayout to add a predefined layout for each entry. Code: Copy Sub CreateReadingItem(dtDateTime As String, Reading As String) As Panel Dim p As Panel p.Initialize("") p.LoadLayout("ReadingItemLayout") Dim chkDateTime As CheckBox Dim lblReading As Label chkDateTime.Text = dtDateTime lblReading.Text = Reading Return p End Sub Then I'm temporarily adding data in the Activity_Create function, by using: Code: Copy ElectricityReadingsList.Add(CreateReadingItem("17/02/2014 - 10:15 PM", "005573.0"), 80dip, "") But I get Panel.LoadLayout should only be called after the panel was added to its parent. (warning #1001), can anyone suggest a way around this? Thanks in advance.
margret Well-Known Member Licensed User Longtime User Feb 18, 2014 #2 This should be: p.Initialize("p") and chkDateTime.Checked = dtDateTime Upvote 0
LucaMs Expert Licensed User Longtime User Feb 18, 2014 #3 Move: Code: Copy Dim chkDateTime As CheckBox Dim lblReading As Label in the "Sub Globals" Upvote 0
Z zombee81 Member Licensed User Longtime User Feb 18, 2014 #4 Thanks LucaMs, that worked a treat! Upvote 0