Derma selecting

local DermaListView = vgui.Create(“DListView”)
DermaListView:SetParent( DermaPanel )
DermaListView:SetPos( 20, 50)
DermaListView:SetSize( 115 , 90)


Its me again and as you can see i have a list with a column in this snip of code pretty much.
And under it i have test1,test,etc.
How could i make it so a player could select one of the options and follow up with running a command?

ex: Click on test1 and it opens a link.

As specified on the wiki page for the DLIstView control, there is a **[DListView.OnRowSelected](** method. In your case, you would do:

[lua]DermaListView.OnRowSelected = function( self, line )
gui.OpenURL( DermaListView:GetLine( line ):GetValue( 1 ) )

That is, if the first column contains the URL. If you don’t want to display the URL with the entry, you can do something like this:

[lua]DermaListView:AddLine(“Test1”).URL = “
DermaListView:AddLine(“Test2”).URL = “
DermaListView:AddLine(“Test3”).URL = “

DermaListView.OnRowSelected = function( self, line )
gui.OpenURL( DermaListView:GetLine( line ).URL )

thanks. it works.