DListView:GetSelected() return string value placed in it?

I am using DListView for an addon i am making and I need GetSelected() to return one of the string values I put in the AddLine(), is that possible?

GetSelected returns the line object, or objects in a table if multi-select is on.

This should show the value, because in DListViewLine it references self.Columns[ i ] = strText and self.Columns[ i ].Value = strText

[lua]local _selected = ListView:GetSelected( );

if ( type( _selected ) == “table” ) then
for k, v in pairs( _selected ) do
PrintTable( v.Columns );
PrintTable( _selected.Columns );

I could’ve sword I saw something where you could do line:GetValue( ) or something similar, but I can’t find the code I wrote because I had to do something similar.

Anyways, I hope that code above helps, it’s what I was able to trace using the garrysmod/lua/vgui/ files.

It worked thanks, but i am going to ask another question on here because I don’t want to make another thread. My addon will run a series of functions and return values. I tried using panel:Refresh() on all of the panels involved as well as running line:SetColumnText( #, str ). None work, is my syntax wrong/what should I use as a method to refresh?

What I did for refreshing a list was when I first started; I cleared the list, and recalled the helper-function which re-populated it.

I suppose you could manage all the data, but it may be easier to clear and repopulate.

ok, thank you