Пример #1
0
        public void SelectGroup(int rowHandle, bool select)
        {
            if (IsGroupRowSelected(rowHandle) && select)
            {
                return;
            }

            for (int i = 0; i < _view.GetChildRowCount(rowHandle); i++)
            {
                int childRowHandle = _view.GetChildRowHandle(rowHandle, i);
                if (_view.IsGroupRow(childRowHandle))
                {
                    SelectGroup(childRowHandle, select);
                }
                else
                {
                    SelectRow(childRowHandle, select, false);
                }
            }

            Invalidate();
        }
Пример #2
0
        protected void BandedView_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
        {
            BandedGridView bandedView = (BandedGridView)MainView;

            if (!bandedView.IsValidRowHandle(e.RowHandle))
            {
                return;
            }
            int parent = bandedView.GetParentRowHandle(e.RowHandle);

            if (bandedView.IsGroupRow(parent))
            {
                for (int i = 0; i < bandedView.GetChildRowCount(parent); i++)
                {
                    if (bandedView.GetChildRowHandle(parent, i) == e.RowHandle)
                    {
                        e.Appearance.BackColor = i % 2 == 0 ? Color.White : Color.WhiteSmoke;
                    }
                }
            }
            else
            {
                e.Appearance.BackColor = e.RowHandle % 2 == 0 ? Color.White : Color.WhiteSmoke;
            }
            e.Appearance.ForeColor = Color.Black;

            // fill column if holiday
            //List<string> columnFieldNameList = ((LeaveDayModule)Screen.Module).GetColumnFieldNameByTypeEndOfWeek();
            //if (columnFieldNameList.Count > 0)
            //{
            //    for (int i = 0; i < columnFieldNameList.Count; i++)
            //    {
            //        if (e.Column.FieldName.Equals(columnFieldNameList[i]))
            //        {
            //            e.Appearance.BackColor = Color.Red;
            //        }
            //    }
            //}
        }