如何在devexpress的gridvew中将按钮添加到最后一行

How to add button to last row in gridvew of devexpress

下面我要
enter image description here
我想在gridview的最后一行添加一个按钮。
可能吗?

我使用页脚完成了此操作。

        public static void CustomDrawFooter(DevExpress.XtraGrid.GridControl gridControl, GridView gridView)
        {
            gridView.OptionsView.ShowFooter = true;
            gridView.FooterPanelHeight = 40;

            // Handle this event to paint the footer panel manually
            gridView.CustomDrawFooter += (s, e) => {
                int Hoffset = 10;
                int Voffset = 5;
                e.DefaultDraw();

                markRectangle = new Rectangle(e.Bounds.X + Hoffset, e.Bounds.Y + Voffset, e.Bounds.Width - 2 * Hoffset, e.Bounds.Height - 2 * Voffset);

                e.Appearance.BackColor = Color.White;
                e.Appearance.FillRectangle(e.Cache, e.Bounds);
                e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                e.Appearance.ForeColor = Color.White;
                e.Appearance.FontSizeDelta = 1;
                e.Appearance.Font = new Font("Segoe UI Semibold", 10);
                e.Appearance.Options.UseTextOptions = true;
                e.Cache.FillRectangle(new SolidBrush(Color.FromArgb(184, 169, 126)), markRectangle);
                e.Appearance.DrawString(e.Cache, "Show more items...", markRectangle);

            };
        }

我添加了 MouseUp 事件。

        private void GridView_MouseUp(object sender, MouseEventArgs e)
        {
            GridHitInfo hitInfo = dmGridView.CalcHitInfo(e.Location);
            if(hitInfo.HitTest == GridHitTest.Footer)
            {
                if ((e.Location.X >= markRectangle.X && e.Location.X <= markRectangle.X + markRectangle.Width) &&
                    (e.Location.Y >= markRectangle.Y && e.Location.Y <= markRectangle.Y + markRectangle.Height))
                    MessageBox.Show("HAHAHAHAHAH");
            }
        }

这有效。