Help me - fill dataGridView from struct array
Hello,
I am using a dataGridView in my dialog based application developed in c#
And I want to fill that dataGridView from a array of structure.
struct student
{
int nRollno;
string strName;
int nTotalMark;
}
I tried as follows,
Code:
student[] arrayStudentList = new student[10];
//Fill 10 student list here and assign as follows
dataGridView.DataSource = m_arrayStudentList;
but columns are displays in different order like as follows:
-------------------------------
nTotalMark | nRollno | strName
-------------------------------
but i want grid display as folows:
-------------------------------
nRollno | strName | nTotalMark
-------------------------------
Please help me.
Thanks
Ranjith.
|