示例#1
0
        /// <summary>
        /// Handles the GridReorder event of the gDocumentTypes control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="GridReorderEventArgs"/> instance containing the event data.</param>
        private void gDocumentTypes_GridReorder(object sender, GridReorderEventArgs e)
        {
            var rockContext         = GetRockContext();
            var documentTypeService = new DocumentTypeService(rockContext);

            var documentTypes = documentTypeService.Queryable().OrderBy(dt => dt.Order).ToList();

            documentTypeService.Reorder(documentTypes, e.OldIndex, e.NewIndex);
            rockContext.SaveChanges();

            BindGrid();
        }