i have a datagridview. i bound it to a list. now i want to show a column at the end of it. but that column apprear in wrong possition.
this is my code
Add column instead of inserting it to the GridView. It will automaticallyy append it to the end of column collection.
grdPatientAppointment.Columns.Add(btnColumn);
just add code below
grdPatientAppointment.Columns.Insert(I, btnColumn)
I is index of column you want to add
Use grdPatientAppointment.AutoGenerateColumns = false;
Then add all columns your grid will receive from DataSource and bind them from editor.
Use DisplayIndex property to change the order of the columns: http://msdn.microsoft.com/en-us/library/wkfe535h.aspx