DListViewLine.SetValue

From GMod Wiki

(Redirected from DListView Line.SetValue)
Jump to: navigation, search
Function
Syntax DListViewLine:SetValue( String text )
Description:
Sets the value in the line.
Returns: nil
In Object: DListViewLine
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DListViewLine.SetValue]DListViewLine.SetValue [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionChanges the value in the second column of the row we click to "Hello"
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:AddLine("Test 3","Test 4")
DList:AddLine("Test 5","Test 6")
DList.OnClickLine = function(parent,selected,isselected) selected:SetValue(2,"Hello") end
 
Would change "Test 2" to "Hello" if we clicked on that row. --Viktor 23:28, 28 July 2008 (GMT-6)
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox