Listview.dll with and without SQLite-Interface

agraham

Expert
Licensed User
Longtime User

Paulsche

Well-Known Member
Licensed User
Longtime User
Hi, ich bekomme bei folgender Zeile einen Fehler beim Compailieren:

lv.SetRowColor = (TBLzeilenFarbe1,TBLzeilenFarbe2)

mit

lv.SetRowColor = (cBeige,cGreen)

funktioniert es.

die Variablen TBLzeilenFarbe1,TBLzeilenFarbe2 enthalten Farbwerte, die ich mit
ColorDialog gewählt habe.

Wo ist der Fehler ? Aaaahh , ich Dummi, das = Zeichen gehört da nicht rein.
 
Last edited:

BPak

Active Member
Licensed User
Longtime User
LoadSQL error

I have downloaded your zip files and have the ListViewSQLite.zip uncompressed and have used the Example.sbp file.

Working on my Desktop (Vista) in the IDE.

It compiles and runs OK but when I click the Load->Load SQL Menu it displays an error:-

An error occured on sub main.mnuloadsql_click.

Line number: 66

lv.LoadSQL(Path & "\Bank1.sl3", "Cashkonto", "", "Datum",False)
Error description:
Could not load file or assembly 'System.Data.SQLite, Version=1.0.60.0,
Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its
dependencies. The system cannot find the file specified.
Continue?

I found the System.Data.SQLite.DLL in the installation Library and placed a copy in the ListView folder.

Why is this error happening? :sign0085:
 

agraham

Expert
Licensed User
Longtime User
I assume that you are using Basic4ppc version 6.90. The version of System.Data.SQLite.dll supplied with v6.90 is 1.0.65.0 but ListViewSQL is compiled to use version 1.0.60.0 as are SQLDesktop.dll and SQLDevice.dll included in the archive. They will need to be recompiled to use the later version.

If you have version 6.80 of Basic4ppc you could use the SQL libraries supplied with that.
 

BPak

Active Member
Licensed User
Longtime User
Thank you.

I have version 6.30 from a few years back.

Now using 6.90.
 
D

Deleted member 103

Guest
Hi,

i have updated my library v1.0.7.7


Ciao,
Filippo
 
D

Deleted member 103

Guest
Unfortunately, this property not exist in the Compact Framwork.
 

georgea

Member
Licensed User
Hello Filippo.

First of all, thank you for this library, it's very usefull.

I wanted to ask you if listview control in compact frmework has any of the capabilities:

1) Something like scrollrow.
2) Show/Hide headers.
3) Click/NoClick Headers.

I am asking, because i think these properties may be very usefull for everyone who uses your library.

Specially for me, listview must auto-scroll to the last added row or scroll to the row i pass as argument, or i really can't use it in almost any application i develop which has to do with database queries.

Thank you in advance.
 

zzoeti

New Member
Licensed User
Longtime User
Listview

Hello,
I am using version 6.90 of Basic4ppc, registered version, and I want to use the the library listviwer. In the freeware version, always displays a "freeware-version". How to remove this message? There is the full version?

thanks.
 

JOTHA

Well-Known Member
Licensed User
Longtime User
Hi zzoeti,
... always displays a "freeware-version". How to remove this message?

If you have the line "lv.About" in your code, the freeware messagebox appears.
Delete this line in your code and the messagebox doesn't come again.

Thats all ...
:)
 
D

Deleted member 103

Guest
Hi georgea,

Specially for me, listview must auto-scroll to the last added row or scroll to the row i pass as argument, or i really can't use it in almost any application i develop which has to do with database queries.
you can use "lv.SelectRow (lv.RowCount-1)" scroll after each new entry to the last entry.

2) Show/Hide headers.
with the functions "ViewAs ..." you can change the representation.


Ciao,
Filippo
 

georgea

Member
Licensed User
Hi Filippo,

Thank you for your answer. I must say that i had already tried the SelectRow method only on the Desktop and it didn't work. Well, it works fine on the Device.

Thank you.
 

Tex8503

Active Member
Licensed User
Longtime User
Hi Filippo
I'm getting ready to implement Listview w/ SQLite in my app - but I just had one question before I do.

I noticed there is password support in the SQLCE version and that the native B4P SQLite libary has support for a password to encrypt the database.

Does Listview have something similar where I can either set and use the password from the B4P library or set a password natively in Listview with SQLite?

Thanks!
 
D

Deleted member 103

Guest
Hi Tex8503,

Does Listview have something similar where I can either set and use the password from the B4P library or set a password natively in Listview with SQLite?

but you can e.g. thus making:
B4X:
Sub Globals
  Dim lvArray(20)
End Sub

Sub App_Start
  con.New1
  raeder.New1
  cmd.New1("",con.Value)
  con.open("Data Source = " & Database, Password)

  lv.New1("Form2",0,0,Form2.Width , Form2.Height)
  lv.FullRowSelect=True
  lv.SetRowColor(cBeige,cSilver)
  lv.Clear

  cmd.CommandText = "SELECT * from [" & Tabelle & "]"
  Raeder.Value = cmd.ExecuteReader
  Do While raeder.ReadNextRow = True
    For c=0 To cmbFeld.Count-1
      lvArray(c)=raeder.GetValue(c)
    Next
    lv.AddRow(lvArray())
  Loop
  Raeder.Close

  Form1.Show
End Sub

Attention this is not a running example!
 

georgea

Member
Licensed User
Hi Filippo.

As i am using your library i have some questions i would like to ask.

First, when no row is selected, the function SelectedRow() returns 0. However, when you select the first row, SelectedRow() returns 0 again. I think that when no row is selected, SelectedRow() should return -1 or something like that.

Second, i wonder if a simple function like SetRowColor() could be created, taking row number also as an argument. That way, you could set other color to any row you want, not only every second. The way it works now, in my opinion, helps listview to have a nice display only and nothing more.

Third, i think i already know the answer but, could it be possible to set font properties for every row? Something like, bold, size, italic, strikethrough, etc. ?

-- EDIT: As i can see in your example, there is also a property called MultiSelect which if i set to true, nothing changes. Is there anything more that i should do? I didn't find anything in the help file, i hope i am not wrong.

Finally, is there any source code for the last version Listview.dll just to see if i could try anything by myself and not disturbing you every time?

Thank you in advance.
 
Last edited:

georgea

Member
Licensed User
As i have no .Net experience, i have been trying to understand how Basic4PPC libraries are created and how they work.

In general, if i got it right, library creators construct something like a "wrapper" for some already created .Net Framework classes and help the users of Basic4PPC to use these classes in a more friendly way, through dlls.

So i examined the ListView Class which is included in System.Windows.Forms and i think i can answer some of my own questions.

  • MultiSelect property is not supported in .Net Compact Framework.
Also, i think that ListViewItem Class is used to display the rows and data of each row into the ListView control . So, if i am right:

  • Font property is not supported for ListViewItem class in .Net Compact Framework.
  • ForeColor and BackColor are supported in .Net Framework. So i think that we could set different text and back color for any row we want using a custom function.
As for the return result of the SelectedRow(), i don't know if dear Filippo modifies the result that his library returns to us or if this result comes straight from the ListView class.

I just wanted to share my thoughts, i hope i didn't misunderstand the whole story and i hope i won't confuse anyone who tries to work with ListView library.

Thank you.
 
D

Deleted member 103

Guest
Hi georgea,

First, when no row is selected, the function SelectedRow() returns 0. However, when you select the first row, SelectedRow() returns 0 again. I think that when no row is selected, SelectedRow() should return -1 or something like that.
The function SelectedRow is not as good, better, it's like this:
B4X:
Sub lv_SelectionChanged
  If lv.SelectedIndicesCount>0 Then
    row=lv.SelectedIndicesItem(0)
  End If
End Sub

Finally, is there any source code for the last version Listview.dll just to see if i could try anything by myself and not disturbing you every time?
If you need the source code then use this library: http://www.b4x.com/forum/additional-libraries/1995-controlsexdevice-library.html#post10811


Ciao,
Filippo
 

georgea

Member
Licensed User
ItemCheck Event

Hi Filippo.

I am trying to use the ListView library with the CheckBoxes property set to True. A have read your help file but i didn't find any event which occurs when you check or uncheck any row.

I searched in the ListView Class and i found that an ItemCheck event exists and is supported in .Net Compact Framework.

Is it possible to use this event to have the job done?

Thank you in advance.
 
Top