Listview.dll with and without SQLite-Interface

agraham

Expert
Licensed User
Longtime User
I can use this line like this?
B4X:
LIstView_CtrlRef=Obj1.FromLibrary("Main.ListViewObjectName", "_LV", B4pObject(2))
No, you cannot bring a reference to a control into Basic4ppc as anything brought in ends up as a String. You have to keep the reference external in a library.
B4X:
Obj1.Value = Obj1.FromLibrary("Main.ListViewObjectName", "_LV", B4pObject(2))
"BaseDados.Load_Tecnicos(ListView.controlRef)" You can't do this either for the same reason. You can only pass a control reference inside Basic4ppc where the name of a Form or control is explicitly expected so Basic4ppc knows what to do with it. Usually this is to pass it to a library as a parameter like passing FormEx.ControlRef to FormLib.ChangeParent.

"cmd.ExecuteTable(ListView.ControlRef,0)" ExecuteTable expects a reference to a DataGrid control or one derived from it like a Basic4ppc Table. As ListView is not derived from a DataGrid this wouldn't work.

I'm not sure what you are trying to achieve - can you explain a bit more?
 
D

Deleted member 103

Guest
"cmd.ExecuteTable(ListView.ControlRef,0)" ExecuteTable expects a reference to a DataGrid control or one derived from it like a Basic4ppc Table. As ListView is not derived from a DataGrid this wouldn't work.

I wanted to say exactly the same...
 

Cableguy

Expert
Licensed User
Longtime User
"cmd.ExecuteTable(ListView.ControlRef,0)" ExecuteTable expects a reference to a DataGrid control or one derived from it like a Basic4ppc Table. As ListView is not derived from a DataGrid this wouldn't work.

I understand it now....
too bad...
I'll try to use a hidden table to get the executetable results and then use the list view to show them...
Thank you all for the input..
 
D

Deleted member 103

Guest
Hello,

i have updated my library v1.0.7.2


Ciao,
Filippo
 

bish0p

Member
Licensed User
Longtime User
image examples

Does anyone have an example of using images with listview?

Thanks

James
 

digitaldon37

Active Member
Licensed User
Longtime User
Listview questions

I'm trying to build an app that looks like the MS App Store client. I have two questions:

1. Does ListView support PNG images? I get an error when trying to load them
2. Can ListView support a multi-line string? I have tried to cat two lines with "&" but both lines print out as a single string
 

Cableguy

Expert
Licensed User
Longtime User
2. Can ListView support a multi-line string? I have tried to cat two lines with "&" but both lines print out as a single string

Usually to force a new text line we should use CRLF, The ampersand "&" only concatenates the strings.
 
D

Deleted member 103

Guest
Hi digitaldon37,

1. Does ListView support PNG images? I get an error when trying to load them
Yes, no problem!
I have already programmed an application in the PNG-file I've used.

Ciao,
Filippo
 

digitaldon37

Active Member
Licensed User
Longtime User
Usually to force a new text line we should use CRLF, The ampersand "&" only concatenates the strings.

Sorry I mean "& CRLF" (not as a string, quotes only for emphasis)

Example:
temp="Line 1" & CRLF & "Line 2"
cells(0) = temp

Puts everything on one line
 

JOTHA

Well-Known Member
Licensed User
Longtime User
Filtering one or more datasets

Hi Filippo,

in your example ...
Here is a small example

PHP:
Sub Globals
  Database=AppPath & "\Northwind.sl3"
  SortAscending=True
End Sub

Sub App_Start
  Form1.Show
  lv.New1("Form1",0,0,Form1.Width , Form1.Height)
  lv.FullRowSelect=True
  lv.SetRowColor(cBeige,cSilver)
  LoadSQL
End Sub

Sub LoadSQL
  lv.Clear
  ' ' lv.loadSQL(Database,"Categories", "", True)
  lv.loadSQL(Database,"Products", "", True)
End Sub

Sub lv_ColumnClick
  SortAscending=Not(SortAscending)
  lv.SortColumn(lv.SelectedColumn,SortAscending)
End Sub

How can i filter one or more datasets like this, but before loading the whole SQL-Database?

Select * FROM Northwind WHERE Description LIKE "%bread%"
End Select

I tried many hours and it must be a simple solution, isn´t it? :sign0085:
 
D

Deleted member 103

Guest
Hallo JOTHA,

hier ein klein Beispiel.

Ciao,
Filippo
 

Attachments

  • ListviewSQLite.zip
    3 KB · Views: 40

JOTHA

Well-Known Member
Licensed User
Longtime User
Hallo JOTHA,

hier ein klein Beispiel.

Ciao,
Filippo

Danke Filippo, wie das mit den SQL-Befehlen zu machen ist, weiß ich schon.

Mich hätte interessiert, wie ich die Daten nicht in einer "normalen Tabelle" (das klappt schon), sondern in deiner Listview-Tabelle sichtbar machen kann.
 
D

Deleted member 103

Guest
In mein Beispiel ist genau den Fall enthalten den du brauchst!
Musst halt genau suchen.:cool:
 
D

Deleted member 103

Guest
I do not know what does not work.
I use it with Basic4ppc 6.8 and it works everything.
 

RichardW

Member
Licensed User
Longtime User
That is interesting. In v6.80, when I load and run your test program ListviewExample.SBP, an error is caused at line:

lv.loadSQL(Database,Tabelle,"", SortFeld, True)

in this routine

Sub mnuLoadSQL2_Click
lv.Clear
'ohne SQLcommand
lv.loadSQL(Database,Tabelle,"", SortFeld, True)
'mit SQLcommand
' lv.loadSQL(Database,Tabelle,"SELECT " & cmbFeld.Item(0) & "," & cmbFeld.Item(1) & " from [" & Tabelle & "]", SortFeld, True)
Form2.Show
End Sub

Here is the text of the error as displayed from basic4ppc:

Error description:
Could not load file or assembly 'system.data.sqlite, Version=1.0.40.0,Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The system cannot find the file specified.

mnuLoadSQL1_Click routine works fine but of course it is using the Reader to populate the listview.
 
Top