DListView.ClearSelection

From GMod Wiki

Jump to: navigation, search
Function
Syntax DListView.ClearSelection( )
Where is this used?
Description:
Deselects all the selected lines.
Returns: nil
Part of Library: DListView
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DListView.ClearSelection]DListView.ClearSelection [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionDeselects all rows when a row is clicked. (Not practical, but shows how to use it)
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) parent:ClearSelection() end
 
OutputWhenever we would click on a row, it would clear all selections, this is not a practical method, as you will be deselecting whatever you had just clicked.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox