Click here to Skip to main content
16,007,111 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Questionadding xpdfviewer control Pin
raj kumar reddy27-Jan-06 17:48
raj kumar reddy27-Jan-06 17:48 
Questionwhere's ToolStripMenuItem.Index? Pin
happycpp27-Jan-06 17:33
happycpp27-Jan-06 17:33 
Answerand where's ToolStripMenuItem.MenuItems? Pin
happycpp28-Jan-06 19:19
happycpp28-Jan-06 19:19 
QuestionAccess Licnese Pin
elraton27-Jan-06 16:24
elraton27-Jan-06 16:24 
AnswerRe: Access Licnese Pin
Matthew Hazlett27-Jan-06 17:01
Matthew Hazlett27-Jan-06 17:01 
QuestionSMTP SSL Pin
Brisunifreddyp27-Jan-06 12:49
Brisunifreddyp27-Jan-06 12:49 
AnswerRe: SMTP SSL Pin
Dave Kreskowiak27-Jan-06 18:15
mveDave Kreskowiak27-Jan-06 18:15 
QuestionColumn Order in a DataGridView with BindingList as DataSource Pin
KoRUPT27-Jan-06 11:28
KoRUPT27-Jan-06 11:28 
I am having problems getting the column order in a DataGridView object to display how I want it. Here are my objects:

Data object
<br />
class CData<br />
{<br />
   //data members<br />
   private uint id;<br />
   private string name;<br />
   private object otherstuff;<br />
   //constructor<br />
   ... //standard<br />
   //get / set<br />
   public uint ID{<br />
      get{ return id; }<br />
      set{ id = value; }<br />
   }<br />
   ... //basic get/set for the other data members<br />


I then create multiple CData objects and place them in a List<CData> object "myList". When I go to bind this list to a DataGridView I use the following code
<br />
BindingList<CData> bindlist = new BindingList<CData>(myList);<br />
myDataGridView.DataSource = bindlist;<br />
myDataGridView.Refresh()<br />


the problem comes when my form is shown and my data is presented. Currently I can not figure out how to order the columns generated from my CData class properties. By default I thought they would show up in the order that they are declared like:

| ID | Name | OtherData |

but I find that the order is chosen at random (or some other factor I can not figure out) and they display something like:

| OtherData | ID | Name |



Now normally this wouldnt be too big of a problem but in my real world application I am using a Data object with over 100 fields which are generated from a file with a strict structure layout and it is critical that I see my columns in the proper order.

I hope I explained this properly and would appreciate any help that can be offered on the matter.

Thank you.


PS: If some moderator or something feels I will get more response in the C# forum, please move this post or advise me to move it.



There are only 10 types of people in this world; Those who understand binary, and those who don't.

-- modified at 17:30 Friday 27th January, 2006
AnswerRe: Column Order in a DataGridView with BindingList as DataSource Pin
KoRUPT30-Jan-06 5:42
KoRUPT30-Jan-06 5:42 
Question.net 2.0 vs 1.1? Pin
Small Rat27-Jan-06 11:15
Small Rat27-Jan-06 11:15 
AnswerRe: .net 2.0 vs 1.1? Pin
Dave Kreskowiak27-Jan-06 11:26
mveDave Kreskowiak27-Jan-06 11:26 
GeneralRe: .net 2.0 vs 1.1? Pin
Paul Conrad27-Jan-06 14:35
professionalPaul Conrad27-Jan-06 14:35 
QuestionDatacolumn type Pin
denizmercan27-Jan-06 5:30
denizmercan27-Jan-06 5:30 
Question.NET Pin
Richard Htin27-Jan-06 4:09
Richard Htin27-Jan-06 4:09 
AnswerRe: .NET Pin
Dave Kreskowiak27-Jan-06 4:56
mveDave Kreskowiak27-Jan-06 4:56 
Question.Net Framework Pin
Net-Programer-and-developer27-Jan-06 3:13
Net-Programer-and-developer27-Jan-06 3:13 
AnswerRe: .Net Framework Pin
Kevin McFarlane27-Jan-06 3:36
Kevin McFarlane27-Jan-06 3:36 
AnswerRe: .Net Framework Pin
Dave Kreskowiak27-Jan-06 4:52
mveDave Kreskowiak27-Jan-06 4:52 
GeneralRe: .Net Framework Pin
Paul Conrad27-Jan-06 5:23
professionalPaul Conrad27-Jan-06 5:23 
AnswerRe: .Net Framework Pin
Colin Angus Mackay27-Jan-06 5:50
Colin Angus Mackay27-Jan-06 5:50 
AnswerRe: .Net Framework Pin
Ravi Bhavnani27-Jan-06 11:25
professionalRavi Bhavnani27-Jan-06 11:25 
QuestionSending mails with attachments curiosity Pin
Alsvha27-Jan-06 2:14
Alsvha27-Jan-06 2:14 
AnswerRe: Sending mails with attachments curiosity Pin
Dave Kreskowiak27-Jan-06 4:51
mveDave Kreskowiak27-Jan-06 4:51 
GeneralRe: Sending mails with attachments curiosity Pin
Alsvha27-Jan-06 5:04
Alsvha27-Jan-06 5:04 
GeneralRe: Sending mails with attachments curiosity Pin
Dave Kreskowiak27-Jan-06 5:48
mveDave Kreskowiak27-Jan-06 5:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.