Esempio n. 1
0
        public static void GridView_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e)
        {
            GridView view = sender as GridView;

            if (view.Name != "GVCTNH")
            {
                DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo info = e.Info as DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo;
                string caption = info.Column.Caption;
                if (info.Column.Caption == string.Empty)
                {
                    caption = info.Column.ToString();
                }
                info.GroupText = string.Format("{0} : {1} (Số dòng = {2})", caption, info.GroupValueText, view.GetChildRowCount(e.RowHandle));
            }
        }
Esempio n. 2
0
        private void View_CustomDrawGroupRow(object sender, RowObjectCustomDrawEventArgs e)
        {
            DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo info = default(DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo);
            info = (DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo)e.Info;

            info.GroupText = " " + info.GroupText.TrimStart();
            e.Info.Paint.FillRectangle(e.Graphics, e.Appearance.GetBackBrush(e.Cache), e.Bounds);
            e.Painter.DrawObject(e.Info);

            Rectangle r = info.ButtonBounds;

            r.Offset(r.Width * 2, 0);

            int g = GroupRowSelectionStatus(e.RowHandle);

            DrawCheckBox(e.Graphics, r, g > 0, g < 0);
            e.Handled = true;
        }