Get and update selected cell in ListView

Discussion in 'Questions (Windows Mobile)' started by tsteward, Apr 26, 2008.

  1. tsteward

    tsteward Active Member Licensed User

    Love the listview library its great and much more visually appealing than the Table.

    How do I get the contents of a selected cell.

    mylv.CELLGET(?,mylv.SelectedRow)

    How can I programitacly get the colname of the selected cell?

    Thanks
    Tony
     
  2. alfcen

    alfcen Well-Known Member Licensed User

    Hi Steward
    Please try this:

    Msgbox(lv1.Cellget(lv1.ColName(0),lv1.SelectedRow))
     
  3. tsteward

    tsteward Active Member Licensed User

    Yeah I understand how to use as above which works if a user clicks the first column.

    I want to know what the cell contains that the user clicks on assuming its not the first column.

    Maybe listview does not allow this and I will have to stick to table!

    Ta
    Tony
     
  4. Filippo

    Filippo Expert Licensed User

    Hallo tsteward,

    Here is a part of help-file Listview.chm.

    Code:
    [B]CellGet[/B]
    Get the value of a specific cell 
    in a ListView.
     
    Syntax: CellGet (ColName 
    As String, RowNumber As Integer) As String
     
    Example:
    value = lv.CellGet(
    "Col1"0)  'Gets the value of the first row in a column named "Col1"
    Code:
    [B]CellSet[/B]
    Sets the value of a specific cell 
    in a ListView.
     
    Syntax:CellSet (ColName 
    As String, RowNumber As Integer, Cell As String)
     
    Examples:
    lv.CellSet(
    "Col1"0"Erel")  'Sets the value of the first row in a column named "Col1" 
     
    ' Fills the first row with the value "Something" in all cells.
    For i = 0 To lv.ColCount-1
         lv.CellSet (lv.ColName(i), 
    0"Something")
    Next

    Ciao,
    Filippo
     
  5. tsteward

    tsteward Active Member Licensed User

    Yeah I realise how to getcell but how do I know exactly what sell a user has tapped/selected.

    I need colselected as well as rowselected
     
  6. specci48

    specci48 Well-Known Member Licensed User

    As I understand the ListView table, you can only select a row but not a column. :(

    Tapping on a different column in an already selected row, there is even no selectionChanged event fired. (see help file for "selectionChanged" => Occurs whenever the selected Row is changed.)

    specci48
     
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