DListViewLine.GetValue

From GMod Wiki

Jump to: navigation, search
Function
Syntax DListViewLine:GetValue( Integer which column to get the data from )
Where is this used?
Description:
Retrieves data in the column specified
Returns: String the data found in the specified column
Part of Library: DListViewLine
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DListViewLine.GetValue]DListViewLine.GetValue [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionPrints the value in the first column, or the row we click.
Used onNewerClient.png
Code
 
local DList = vgui.Create ( "DListView" )
DList:SetPos(25,25)
DList:SetSize(50,50)
DList:SetMultiSelect(false)
DList:AddColumn("Column 1")
DList:AddColumn("Column 2")
DList:AddLine("Test 1","Test 2")
DList.OnClickLine = function(parent,selected,isselected) print(selected:GetValue(1)) end
 
In this set up, it would print "Test 1" to console, since it is the first column.
Output"Test 1"
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox