Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 10th, 2008, 11:53 PM
Registered User
Join Date: May 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help me - fill dataGridView from struct array


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,

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.


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
pointer to struct goscho C++ Programming 1 January 10th, 2008 07:23 AM
Dynamic array of struct bobwrx C# 2 September 14th, 2006 06:12 AM
fill two-dimensional array tobian Excel VBA 0 February 21st, 2006 05:55 PM

All times are GMT -4. The time now is 10:08 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.