예제 #1
0
        protected void gvQuery_SortCommand(object source, Ares.Cimes.IntelliService.Web.UI.CimesSortedArgs e)
        {
            try
            {
                //若為第一筆為新增模式,則按下該排序按鈕
                //if (ToolTypeList[0].InfoState == InfoState.NewCreate)
                //{
                //    ToolTypeList.RemoveAt(0);
                //}
                removeListAddandDeletRow();
                gvQuery.SetDataSource(ToolTypeList);
                gvQuery.EditItemIndex = -1;

                if (GridViewSortDirection == SortDirection.Ascending)
                {
                    GridViewSortDirection = SortDirection.Descending;
                    ToolTypeList          = ToolTypeList.OrderByDescending(p => p[e.CimesSortField].ToString()).ToList();
                }
                else
                {
                    GridViewSortDirection = SortDirection.Ascending;
                    ToolTypeList          = ToolTypeList.OrderBy(p => p[e.CimesSortField].ToString()).ToList();
                }

                gvQuery.DataBind();
            }
            catch (Exception ex)
            {
                HandleError(ex, CurrentUpdatePanel, string.Empty, MessageShowOptions.OnLabel);
            }
        }
예제 #2
0
 protected void gvToolList_CimesSorted(object sender, Ares.Cimes.IntelliService.Web.UI.CimesSortedArgs e)
 {
     try
     {
         ClearFieldAndDisableTab();
     }
     catch (Exception ex)
     {
         HandleError(ex);
     }
 }