ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
InlineGrid - How to apply default sort column and Sort Type(ASC, DESC)
Title:
B
I
{code}
?
Please suggest how to apply default sort column and Sort Type(ASC, DESC) to InlineGridDemo
Save Changes
Cancel
samp
asked at 08 Feb 2016
Answers
B
I
{code}
?
by default (when the user hasn't clicked any columns yet) the grid is sorted by key desc, you can change that by setting DefaultKeySort new GridModelBuilder(...) { Key = "Id", DefaultKeySort = Sort.Asc you can also set g.SortNames and g.SortDirections, something like (probably this is what you want) if(g.SortNames == null || g.SortNames.Length == 0){ g.SortNames = new [] { "Name" }; // "Name" doesn't have to be in the list of defined columns g.SortDirections = new [] { "asc" }; }
Save Changes
Cancel
Omu
answered at 08 Feb 2016
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK