Advertisement

01.30.2006 at 09:30AM PST, ID: 21715705
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.2

Column Order in a DataGridView with BindingList as DataSource

Asked by ISOPimp in .NET

Tags: , , ,

I am having problems getting the column order in a DataGridView object to display how I want it. Here are my objects:

Data object

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


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

BindingList<CData> bindlist = new BindingList<CData>(myList);
myDataGridView.DataSource = bindlist;
myDataGridView.Refresh()


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.

Start Free Trial
[+][-]02.07.2006 at 09:48PM PST, ID: 15899956

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: .NET
Tags: datagridview, order, bindinglist, column
Sign Up Now!
Solution Provided By: amyhxu
Participating Experts: 1
Solution Grade: B
 
 
[+][-]02.08.2006 at 08:53AM PST, ID: 15904143

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.02.2006 at 03:52AM PST, ID: 16083803

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 14-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43