Advertisement

04.22.2008 at 01:18AM PDT, ID: 23342123
[x]
Attachment Details

DataGridView DisplayIndex not working.

Asked by DColin in Microsoft Visual Basic.Net

Hi Experts,

I am using the attached code to populate and display a DataGridView control.

The DataGridView fills with the DataSet's data and the columns AutoSize. This would indicate the first two lines of code are executing correctly, but when it comes to the DisplayIndex the columns are in a random order, not the order I specify.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
DataGridViewLeagueData.DataSource = LeagueInfoDataSet.Tables(0).DefaultView
 
DataGridViewLeagueData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
 
DataGridViewLeagueData.Columns("GoalSup").DisplayIndex = 0
DataGridViewLeagueData.Columns("MatchDate").DisplayIndex = 1
DataGridViewLeagueData.Columns("TeamACalc").DisplayIndex = 2
DataGridViewLeagueData.Columns("TeamBCalc").DisplayIndex = 3
DataGridViewLeagueData.Columns("MatchGrade").DisplayIndex = 4
DataGridViewLeagueData.Columns("TeamA").DisplayIndex = 5
DataGridViewLeagueData.Columns("TeamB").DisplayIndex = 6
DataGridViewLeagueData.Columns("TeamAPoints").DisplayIndex = 7
DataGridViewLeagueData.Columns("TeamAGamesPlayed").DisplayIndex = 8
DataGridViewLeagueData.Columns("TeamBPoints").DisplayIndex = 9
DataGridViewLeagueData.Columns("TeamBGamesPlayed").DisplayIndex = 10
DataGridViewLeagueData.Columns("League").DisplayIndex = 11
[+][-]04.22.2008 at 01:45AM PDT, ID: 21409074

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]04.22.2008 at 01:48AM PDT, ID: 21409083

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 01:58AM PDT, ID: 21409122

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]04.22.2008 at 02:04AM PDT, ID: 21409155

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 02:38AM PDT, ID: 21409299

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]04.22.2008 at 05:46AM PDT, ID: 21410450

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]04.22.2008 at 08:36PM PDT, ID: 21417605

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.23.2008 at 12:15AM PDT, ID: 21418337

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]04.25.2008 at 10:20PM PDT, ID: 21444602

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 03:04AM PDT, ID: 21445043

View this solution now by starting your 7-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: Microsoft Visual Basic.Net
Sign Up Now!
Solution Provided By: Sancler
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.26.2008 at 09:49AM PDT, ID: 21446067

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628