Click here to Skip to main content
15,890,932 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I am using .Net window application.

I have 1 grideview and I am adding 1 button in gridview.

But the button appears in the first column.

I want it to be in the last column or mid of my bounds column.

Why can't I reorder the column in the table?
Like in asp.net gridview.
Posted
Updated 7-Aug-11 22:29pm
v2

1 solution

How you add the column?
You can use
C#
DataGridView1.Columns.Insert(index, New DataGridViewButtonColumn());

You can use DisplayIndex of a column to reorder existing columns.
 
Share this answer
 
v2
Comments
dilip.aim11 8-Aug-11 5:37am    
i want to add through wizard....

Why i can't reorder the columns which is coming from tables...
Prerak Patel 8-Aug-11 6:15am    
In design time, you can reorder columns in DataGridView. If you are adding column at runtime, I told you how to add at specified index. You can use DisplayIndex to change existing column's index.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900