How to get the "Student ID" (DataListView not DataGridView)

BenTam-3003 686 Reputation points
2022-03-19T04:25:10.187+00:00

Dear All,

Originally, "Student ID" was in column 0. I got it by using the statement "StudentList_Form.FocusedItem.Text". Now "Student ID" moves to column 1 and "StudentList_Form.FocusedItem.Text" will return "Asiagift". I'd like to ask how to get the value of "Student ID" (i.e., 000159)?

184660-studentlist-form.gif

Developer technologies | C#
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 90,686 Reputation points
    2022-03-19T08:26:14.53+00:00

    If StudentList_Form is your DataListView, you can get it with :

    StudentList_Form.SelectedItem.SubItems[1].Text;


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.