DListView Line/GetColumnText

From Garry's Mod
Jump to: navigation, search
 DListView_Line:GetColumnText( )

Contents

DescriptionPanelFunc

Gets the string held in the specified column of a DListView_Line panel.

This is the same thing as doing DListView_Line:GetValue( column_number ).

Arguments

number column

The number of the column to retrieve the text from, starts with 1.

Returns

string

The contents of the specified column.

Examples

Example

local dframe = vgui.Create("DFrame")
dframe:SetSize(450, 350)
dframe:Center()

local dlist = vgui.Create("DListView", dframe)
dlist:Dock(FILL)
dlist:SetMultiSelect(false)
dlist:AddColumn("Name")
dlist:AddColumn("SteamID")
dlist:AddLine("Stalker", "STEAM_0:1:18093014")
function dlist:DoDoubleClick(linenumber, lineinfo)
	print(lineinfo:GetColumnText(2))
end

Output:

Prints "STEAM_0:1:18093014" when the line containing Stalker is double clicked.
Personal tools
Navigation