This is a migrated thread and some comments may be shown as answers.

Database to Gridview

1 Answer 26 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vincent
Top achievements
Rank 1
Vincent asked on 21 May 2011, 01:25 PM
HI!

I am able to connect data from database to gridview... but my problem is... When data are bind to gridview, it is automatically sorted alphabetically... I want it to follow the sequence in the class that I declared... for example... 

public class Structure
    {
        public int EventID { get; set; }
        public DateTime EventDate { get; set; }
        public DateTime EventTime { get; set; }
        public string StructureName { get; set; }
        public double Anomaly{ get; set; }
        public double Northing { get; set; }
        public double KP { get; set; }
        public int TaskID { get; set; }
       
    }

in the gridview it starts with Anomaly and etc........ 
I want it to sequence like the way I declared it... Is there such a way to do it?? Thanks!

1 Answer, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 21 May 2011, 03:19 PM
Hi Vincent,

 

You may handle the RadGridView's AutoGeneratingColumn event to customize auto-generated columns. In order to rearrange the display order of the columns, you can set the DisplayIndex property for individual columns.


Regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Vincent
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or