DListView:OnRowSelected
Description
Called internally by DListView:OnClickLine when a line is selected. This is the function you should override to define the behavior when a line is selected.
Arguments
Example
Prints the first two column values of the row that was clicked. In this example it's the nickname and kills of the player selected in the list
local frame = vgui.Create( "DFrame" )
frame:SetSize( 300, 300 )
frame:MakePopup()
local listView = frame:Add( "DListView" )
listView:Dock( FILL )
listView:AddColumn( "Nick" )
listView:AddColumn( "Frags" )
for i, ply in ipairs( player.GetAll() ) do
listView:AddLine( ply:Nick(), ply:Frags() )
end
listView.OnRowSelected = function( panel, rowIndex, row )
print( row:GetValue( 1 ) )
print( row:GetValue( 2 ) )
end