H HengeDK Member Licensed User Longtime User Jun 18, 2013 #1 I have populated a listview with Code: Copy DBUtils.ExecuteListView(SQL, "Select * from news",Null, 0, ListNews, True) How can I get a return value from listview that I can use for selecting the current record in item_click thanks
I have populated a listview with Code: Copy DBUtils.ExecuteListView(SQL, "Select * from news",Null, 0, ListNews, True) How can I get a return value from listview that I can use for selecting the current record in item_click thanks
klaus Expert Licensed User Longtime User Jun 18, 2013 #2 When you click on an item in the ListView the Value object returned contains a string array with the content of the whole row with all the colums according to the query. In your case with SELECT * FROM you get the whole row (all columns) in return. Best regards. Upvote 0
When you click on an item in the ListView the Value object returned contains a string array with the content of the whole row with all the colums according to the query. In your case with SELECT * FROM you get the whole row (all columns) in return. Best regards.
H HengeDK Member Licensed User Longtime User Jun 18, 2013 #3 Thanks for your reply What do you suggest I do then ? I want to get the value of colum story in that table can I use listview.AddTwoLines2 with dbutils.executelistview ? Upvote 0
Thanks for your reply What do you suggest I do then ? I want to get the value of colum story in that table can I use listview.AddTwoLines2 with dbutils.executelistview ?
klaus Expert Licensed User Longtime User Jun 18, 2013 #4 It depends on what you want to show and what other value you want to use. In this example: DBUtils.ExecuteListView(SQL, "SELECT ColX, ColY, ColID FROM news",Null, 0, ListNews, True) ColX and ColY will be displayed in the ListView. When clicking on an item in ListNews, you get in Code: Copy Sub ListNews_ItemClick (Position As Int, Value As Object) Dim cols() as String Dim ID As Int cols = Value ' cols(0) -> content of ColX ' cols(1) -> content of ColY ID = cols(2) ' content of ColID Best regards. Upvote 0
It depends on what you want to show and what other value you want to use. In this example: DBUtils.ExecuteListView(SQL, "SELECT ColX, ColY, ColID FROM news",Null, 0, ListNews, True) ColX and ColY will be displayed in the ListView. When clicking on an item in ListNews, you get in Code: Copy Sub ListNews_ItemClick (Position As Int, Value As Object) Dim cols() as String Dim ID As Int cols = Value ' cols(0) -> content of ColX ' cols(1) -> content of ColY ID = cols(2) ' content of ColID Best regards.