Пример #1
0
        private void tsbGridView_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e)
        {
            DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo info = e.Info as DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo;
            DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
            string s = "";

            foreach (DevExpress.XtraGrid.GridGroupSummaryItem g in view.GroupSummary)
            {
                if (g.ShowInGroupColumnFooter == null)
                {
                    if (s != string.Empty)
                    {
                        s += " ";
                    }
                    s += view.GetGroupSummaryDisplayText(e.RowHandle, g);
                }
            }
            //var aaa = view.GetGroupSummaryValues(e.RowHandle).Values;
            //decimal gCnt = Convert.ToDecimal(view.GetChildRowCount(e.RowHandle));
            int     c    = 0;
            decimal gCnt = Convert.ToDecimal(getChildRows(view, e.RowHandle, ref c));
            decimal tCnt = Convert.ToDecimal(tsbGridView.DataRowCount);

            //decimal tCnt = Convert.ToDecimal(colTSBID.SummaryItem.SummaryValue);
            if (tCnt != 0)
            {
                decimal pc = Math.Round(gCnt / tCnt * 100, 0);
                s += string.Format(" %{0}", pc);
            }

            info.GroupText = string.Format(view.GroupFormat, info.Column.Caption, info.GroupValueText, s);
        }
Пример #2
0
        private void grvDanhMuc_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e)
        {
            GridView view = sender as GridView;

            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} (" + sCount.Trim() + " = {2})", caption, info.GroupValueText, view.GetChildRowCount(e.RowHandle));
        }
Пример #3
0
        private void gridView1_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e)
        {
            DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo info = e.Info as DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo;
            DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
            string s = "";

            foreach (DevExpress.XtraGrid.GridGroupSummaryItem g in view.GroupSummary)
            {
                if (g.ShowInGroupColumnFooter == null)
                {
                    if (s != string.Empty)
                    {
                        s += " ";
                    }
                    s += view.GetGroupSummaryDisplayText(e.RowHandle, g);
                }
            }
            info.GroupText = string.Format(view.GroupFormat, info.Column.Caption, info.EditValue, s);
        }
Пример #4
0
        private void gridViewSaleInvoice_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e)
        {
            DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo info = e.Info as DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo;
            switch (info.EditValue.ToString())
            {
            case "0":
                info.GroupText = "فواتير غير مؤكدة";
                break;

            case "1":
                info.GroupText = "فواتير  مؤكدة";
                break;


            case "2":
                info.GroupText = "فواتير راجعه ";
                break;
            }
            // string.Format(view.GroupFormat, info.Column.Caption, info.EditValue, s);
        }