C# 如何将按钮添加到devexpress的gridvew中的最后一行
我想要下面的内容。C# 如何将按钮添加到devexpress的gridvew中的最后一行,c#,gridview,devexpress,C#,Gridview,Devexpress,我想要下面的内容。 我想在gridview的最后一行添加一个按钮。 有可能吗?我已经用页脚完成了这项工作 public static void CustomDrawFooter(DevExpress.XtraGrid.GridControl gridControl, GridView gridView) { gridView.OptionsView.ShowFooter = true; gridView.Foote
我想在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");
}
}
private void GridView\u MouseUp(对象发送方,MouseEventArgs e)
{
GridHitInfo hitInfo=dmGridView.CalcHitInfo(e.Location);
if(hitInfo.HitTest==GridHitTest.Footer)
{
如果((e.Location.X>=markRectangle.X&&e.Location.X=markRectangle.Y&&e.Location.Y