Posted on Feb 3, 2011 (permalink)
private
void
gridView_Sorting(
object
sender, GridViewSortingEventArgs e)
{
try
if
(schedules ==
null
)
e.Cancel =
true
;
return
}
(e.OldSortingState == SortingState.Ascending)
e.NewSortingState = SortingState.Descending;
schedules = schedules.OrderByDescending(s => s.Role).ThenBy(s => s.Name).ToList();
else
(e.OldSortingState == SortingState.Descending)
schedules = schedules.OrderByDescending(s => s.Name).ToList();
e.NewSortingState = SortingState.None;
e.NewSortingState = SortingState.Ascending;
schedules = schedules.OrderBy(s => s.Role).ThenBy(s => s.Name).ToList();
this
.radDataPager.Source = schedules;
//e.DataControl.ItemsSource = this.radDataPager.Source; // replaced by the next line which is the same thing.
.gridView.ItemsSource =
.radDataPager.Source;
.gridView.Items.Refresh();
.radDataPager.PageIndex = 0;
catch
(Exception ex)
txtStatus.Text =
"Erorr in gridView_Sorting:"
+ex.Message;
Reply
Posted on Feb 7, 2011 (permalink)
Back to Top
UI controls for ASP.NET AJAX, MVC, WPF,Silverlight, Windows 8 and Windows Phone
Cross-platform Mobile Development Toolwith cloud-based architecture
Everything you need to build sites andmobile apps with JavaScript and HTML5
One easy tool for Functional, Performance,Load and Mobile software testing
Everything for your online business - contentmanagement, ecommerce, emarketing
Simple and intuitive project managementand collaboration software