[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 317
  • Last Modified:

getting the display member from a selected item in my listbox

Hi,

I have the following code:
For i = 0 To lstLineFinder.Items.Count - 1
            dr = _tblSelectedLines.NewRow

            dr.Item("Line ID") = lstLineFinder.Items.Item(i).ToString

            _tblSelectedLines.Rows.Add(dr)
        Next

I am binding the datatable to my gridview but that field is being displayed as:
"System.Data.DataRowView"

What am I doing wrong?

I need the value of the selected item?!
0
scm0sml
Asked:
scm0sml
1 Solution
 
CodeCruiserCommented:
Try changing

dr.Item("Line ID") = lstLineFinder.Items.Item(i).ToString

to

dr.Item("Line ID") = lstLineFinder.Items.Item(i)(0)

where 0 means first column
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now