Filippo's listview bugs

Discussion in 'Questions (Windows Mobile)' started by RB Smissaert, Dec 31, 2008.

  1. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    Sofar I have come across 2 bugs in this control.
    When doing a column sort (lvw.SortColumn and also lvw.TableSort) the background colour of the control disappears. Resetting it after the sort doesn't help.
    Secondly, setting the column widths in AddColumn doesn't behave as expected in that setting the value -1 (to autofit) doesn't work and gives very narrow columns.
    Not a bug, but it is also quite a bit slower than the simple Table control, particularly on populating the control. This is when doing:

    Reader.Value = cmd.ExecuteReader

    Do While Reader.ReadNextRow = True
    For c = 0 To UB
    arrLVWRow(c) = Reader.GetValue(c)
    Next
    lvw.AddRow(arrLVWRow())
    lRecords = lRecords + 1
    Loop

    And maybe I should use lvw.LoadSQL but that means I have to make a temp
    SQLite table first.


    RBS
     
  2. Filippo

    Filippo Expert Licensed User

    Hi RB Smissaert,

    I would say use only lvw.LoadSQL and lvw.SaveSQL, because it it much faster.
    But if you want to load the tables over "Reader.Value = cmd.ExecuteReader ... " then you have to use the functions lvw.BeginUpdate and lvw.EndUpdate.


    Example:
    lvw.BeginUpdate
    Reader.Value = cmd.ExecuteReader

    Do While Reader.ReadNextRow = True
    For c = 0 To UB
    arrLVWRow(c) = Reader.GetValue(c)
    Next
    lvw.AddRow(arrLVWRow())
    lRecords = lRecords + 1
    Loop
    lvw.BeginUpdate


    Ciao,
    Filippo
     
  3. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    But how can I use LoadSQL in combination with a WHERE clause or a join?

    RBS
     
  4. Filippo

    Filippo Expert Licensed User

    currently only with "reader.Value = cmd.ExecuteReader ..." :sign0013:
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice