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

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,648 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 83,206 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