프로젝트

일반

사용자정보

개정판 51de3ce4

ID51de3ce4a47c886d5dfd62cc25075d1891bcf795
상위 db0a50f0
하위 e22c6926

유성호이(가) 일년 이상 전에 추가함

issue #0000
main 화면에 check count 추가
작업자 위치 변경

Change-Id: I3502c27b241ef9937246893bf17ff4e49dd79946

차이점 보기:

ID2.Manager/ID2.Manager/Main.cs
23 23

  
24 24
using Telerik.WinControls;
25 25
using Telerik.WinControls.UI;
26
using Telerik.WinControls.Enumerations;
26 27

  
27 28
using GemBox.Spreadsheet;
28 29

  
......
145 146
            //this.radGridViewDocuments.FilterChanging += RadGridViewDocuments_FilterChanging;
146 147
            this.radGridViewDocuments.FilterChanged += RadGridViewDocuments_FilterChanged;
147 148
            //this.radGridViewDocuments.CellValidated += RadGridViewDocuments_CellValidated;
148
            this.radGridViewDocuments.ValueChanged += RadGridViewDocuments_ValueChanged;
149
            this.radGridViewDocuments.HeaderCellToggleStateChanged += RadGridViewDocuments_HeaderCellToggleStateChanged;
149 150
            this.radGridViewDocuments.ValueChanging += RadGridViewDocuments_ValueChanging;
151
            this.radGridViewDocuments.ValueChanged += RadGridViewDocuments_ValueChanged;
150 152
            this.radGridViewDocuments.MultiSelect = true;
151 153
            this.radGridViewDocuments.EnableHotTracking = true;
152 154
            this.radGridViewDocuments.MasterView.TableHeaderRow.MinHeight = 36;
......
178 180
            this.Initialize();
179 181
        }
180 182

  
181
        private void RadGridViewDocuments_ValueChanging(object sender, ValueChangingEventArgs e)
182
        {
183
            if(sender is GridViewCellInfo)
184
            {
185
                if ((sender as GridViewCellInfo).ColumnInfo is GridViewCheckBoxColumn)
186
                {
187
                    if (this.radGridViewDocuments.SelectedRows.Count() > 1)
188
                    {
189
                        if(!this.radGridViewDocuments.SelectedRows.Contains((sender as GridViewCellInfo).RowInfo))
190
                        {
191
                            e.Cancel = true;
192
                        }
193
                    }
194
                }
195
            }
196
        }
197

  
198 183
        /// <summary>
199 184
        /// 사용자가 선택한 테마를 적용한다.
200 185
        /// </summary>
......
1837 1822

  
1838 1823
        private void RadGridViewDocuments_FilterChanged(object sender, GridViewCollectionChangedEventArgs e)
1839 1824
        {
1825
            this.radGridViewDocuments.ClearSelection();
1826
            if (e.GridViewTemplate.DataView.Count > 0)
1827
            {
1828
                e.GridViewTemplate.DataView[0].IsSelected = true;
1829
            }
1830

  
1840 1831
            this.lbSelectAndTotal.Text = $"{e.GridViewTemplate.DataView.Count} / {this.SearchCount} / {this.TotalCount} (Filter / Search / Total)";
1832
            this.lbChecked.Text = $"Checked : {this.GetCheckedRows(true).Count()}";
1841 1833
        }
1842 1834

  
1843 1835
        private void RadGridViewDocuments_CellValidated(object sender, CellValidatedEventArgs e)
......
1995 1987
            }
1996 1988
        }
1997 1989

  
1990
        private void RadGridViewDocuments_HeaderCellToggleStateChanged(object sender, GridViewHeaderCellEventArgs e)
1991
        {
1992
            if (sender is RadElement elem)
1993
            {
1994
                if (elem.IsMouseOverElement)//header를 직접 눌렀을 경우 - 미리 예상해야함
1995
                {
1996
                    //on, off 에 따라서 보여지는 거 다 체크이거나 다 언체크
1997

  
1998
                    //this.radGridViewDocuments.FilterDescriptors
1999
                    var selectedRows = this.radGridViewDocuments.SelectedRows;
2000

  
2001
                    if (selectedRows.Count > 1)
2002
                    {
2003
                        var chkRows = this.GetCheckedRows(true);
2004
                        var selectedCheckedRows = selectedRows.AsEnumerable<GridViewRowInfo>()
2005
                                                              .Where(x =>
2006
                                                              {
2007
                                                                  return x.Cells["Checked"].Value != null && Convert.ToBoolean(x.Cells["Checked"].Value);
2008
                                                              });
2009
                        var selectedUncheckedRows = selectedRows.Except(selectedCheckedRows);
2010

  
2011
                        int checkedCount = 0;
2012

  
2013
                        if (e.State == ToggleState.On)
2014
                        {
2015
                            checkedCount = chkRows.Count() + selectedUncheckedRows.Count();
2016
                        }
2017
                        else
2018
                        {
2019
                            checkedCount = chkRows.Count() - selectedCheckedRows.Count();
2020
                        }
2021

  
2022
                        this.lbChecked.Text = $"Checked : {checkedCount}";
2023
                    }
2024
                    else
2025
                    {
2026
                        if (e.State == ToggleState.On)
2027
                        {
2028
                            this.lbChecked.Text = $"Checked : {this.radGridViewDocuments.MasterTemplate.DataView.Count}";
2029
                        }
2030
                        else
2031
                        {
2032
                            this.lbChecked.Text = $"Checked : {0}";
2033
                        }
2034
                    }
2035
                }
2036
                else//filter 나 item check box 체크 등 다른 이유로 헤더에 체크가 됐을 경우는 get... 이거로 해도 됨
2037
                {
2038
                    this.lbChecked.Text = $"Checked : {this.GetCheckedRows(true).Count()}";
2039
                }
2040
            }
2041
        }
2042

  
2043
        private void RadGridViewDocuments_ValueChanging(object sender, ValueChangingEventArgs e)
2044
        {
2045
            if (sender is GridViewCellInfo)
2046
            {
2047
                if ((sender as GridViewCellInfo).ColumnInfo is GridViewCheckBoxColumn)
2048
                {
2049
                    if (this.radGridViewDocuments.SelectedRows.Count() > 1)
2050
                    {
2051
                        if (!this.radGridViewDocuments.SelectedRows.Contains((sender as GridViewCellInfo).RowInfo))
2052
                        {
2053
                            e.Cancel = true;
2054
                        }
2055
                    }
2056
                }
2057
            }
2058
        }
2059

  
1998 2060
        private void RadGridViewDocuments_ValueChanged(object sender, EventArgs e)
1999 2061
        {
2000 2062
            if (sender is BaseGridEditor baseEditor)
......
2006 2068
                        switch (cellElem.ColumnInfo.Name)
2007 2069
                        {
2008 2070
                            case "Checked":
2071
                                this.radGridViewDocuments.EndEdit();
2072
                                this.lbChecked.Text = $"Checked : {this.GetCheckedRows(true).Count()}";
2073
                                break;
2009 2074
                            case "RefProjectCode":
2010 2075
                            case "PersonInCharge":
2011 2076
                            case "Worker":
......
2825 2890
            List<string> chkColNames = new List<string>() { "Checked" };
2826 2891

  
2827 2892
            List<string> docLinkColNames = new List<string>() { "AutoCADLink", "ID2Connection", "PDFLink", "MarkupLink", "AVEVALink", "Compare" };
2828
            List<string> docInfoColNames = new List<string>() { "RefProjectCode", "System", "DocumentNo", "PersonInCharge" };
2829
            List<string> docOtherInfoColNames = new List<string>() { "SubSystemCode", "Worker", "AVEVAPersonInCharge", "AVEVAWorker", "JobLevel", "RevisonNo" };
2893
            List<string> docInfoColNames = new List<string>() { "RefProjectCode", "System", "DocumentNo", "PersonInCharge", "Worker" };
2894
            List<string> docOtherInfoColNames = new List<string>() { "SubSystemCode", "AVEVAPersonInCharge", "AVEVAWorker", "JobLevel", "RevisonNo" };
2830 2895
            List<string> rvToColNames = new List<string>() { "ToIsDiscussion", "ToRemarks", "ToCreator", "ToCapture" };
2831 2896
            List<string> rvFrColNames = new List<string>() { "FrReviewStatus", "FrRemarks", "FrCreator", "FrCapture" };
2832 2897
            List<string> wkID2ColNames = new List<string>() { "ID2StartDate", "ID2EndDate", "ID2Status", "ID2Issues", "ID2Capture", "ReplyModifications", "ReplyRequester" };

내보내기 Unified diff