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

Column sorting

3 Answers 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Zia
Top achievements
Rank 1
Zia asked on 07 Jun 2010, 03:59 PM
Hello everyone,

In my grid I have 4 columns. Name, Phone, Address and Sales Person. While getting information from SQL, I am getting first 3 columns in one query and fourth column in second query. Order of grid should be by default alphabetically from column "Name". But it is showing in order of Sales Person. If I dont run the second query to get sales person information, my order is according to Name (i.e. first Column).

Is there anyway that I can set the default order for Column "Name" and also at the same time when someone click on any other column, order of grid should change according to that (which is working now as well).
In brief, when grid loads for first time it should be in alphabetical order of column Name and not column Sales person at the same time it should still allow user to change order by clicking on any of the columns headertext.

Thanks

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 10 Jun 2010, 10:09 AM
Hello Zia,

You can try out swapping of columns to reorder them as shown in the help link below:

http://www.telerik.com/help/aspnet-ajax/grdreorderingcolumns.html(Reordering columns programmatically)


Regards,
Maria Ilieva
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.
0
Zia
Top achievements
Rank 1
answered on 10 Jun 2010, 01:45 PM
OK....but that will happen when user does it. I want column "Name" to be default when grid loads for first time.
0
Maria Ilieva
Telerik team
answered on 11 Jun 2010, 03:24 PM
Hello Zia,

You can try to set column.OrderIndex in order to place the needed column on first place in the RenderColumns collection.


All the best,
Maria Ilieva
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
Grid
Asked by
Zia
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Zia
Top achievements
Rank 1
Share this question
or