我正在制作学生管理系统项目。我使用链接列表来保存我的数据并自己创建链接列表。我想知道如何将链表绑定到数据网格。
链接列表代码在这里:
节点类:
public class StudentData
{
private string nameStudent;
public string NameStudent
{
get { return nameStudent; }
set { nameStudent = value; }
}
private string fathernameStudent;
public string FathernameStudent
{
get { return fathernameStudent; }
set { fathernameStudent = value; }
}
private UInt32 seatNumberStudent;
public UInt32 SeatNumberStudent
{
get { return seatNumberStudent; }
set { seatNumberStudent = value; }
}
.......
}
列表类:
class StudentManagment
{
private StudentData first;
internal StudentData First
{
get { return first; }
//set { first = value; }
}
public void addANewStudent(string name, string fathername, ...... , string school)
{
StudentData newlyCreatedStudent = new StudentData(name, fathername,.....,school);
newlyCreatedStudent.Next = first;
first = newlyCreatedStudent;
}
}
首先包含列表中第一个节点的引用。
如何将其绑定到数据网格视图,以便我可以在窗口中显示它。