با عرض سلام خدمت دوستان
من تو برنام هام تقریباً از همه کامپوننت های گرید ویو استفاده کردم که بالاخره تو یجا دچار مشکل شده و کارائی مورد نظر را نخواهد داشت
کاشکی میشد دوستان تجربیات خودشونو به شراکت گذاشته تا یه ابزار grid با امکانات گروه بندی ، فیلترینگ ، سطر محاسباتی برای نمایش محاسبات ، فریز کردن سطر نمایش تصویر زمینه و از همه مهمتر راست به چپ شدن و نمایش انواع داده ها در ستو نها و نمایش درختی را بسازیم و همه دوستان از این ابزار استفاده کنند
کد زیر ابتدائی ترین امکانات گرید رو داره از دوستان خواهش میکنم که کمک کنند کاملش کنم
public class DataGridView : System.Windows.Forms .DataGridView
{
private System.Drawing.Image image;
[DllImport("user32.dll")]
private static extern IntPtr GetDCEx(IntPtr hwnd, IntPtr hrgnclip, uint fdwOptions);
[Category("Appearance")]
public System.Drawing.Image Image
{
get
{
return this.image;
}
set
{
this.image = value;
base.Invalidate();
}
}
protected override void PaintBackground(Graphics graphics, Rectangle clipBounds, Rectangle gridBounds)
{
base.PaintBackground(graphics, clipBounds, gridBounds);
if (this.image != null)
graphics.DrawImage(this.Image, gridBounds);
}
protected override void OnScroll(ScrollEventArgs e)
{
base.OnScroll(e);
this.Refresh();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
DataGridViewCellStyle style = new DataGridViewCellStyle();
style.BackColor = SystemColors.GradientActiveCaption;
this.AlternatingRowsDefaultCellStyle = style;
this.RowHeadersWidth = 35;
this.RowHeadersDefaultCellStyle.Padding = new Padding(this.RowHeadersWidth);
}
protected override void OnRowPostPaint(DataGridViewRowPostPaintEventArgs e)
{
base.OnRowPostPaint(e);
SolidBrush brushes = new SolidBrush(Color.Black);
if (base.RightToLeft == RightToLeft.Yes)
e.Graphics.DrawString((e.RowIndex + 1).ToString(), this.Font, brushes, base.Width - e.RowBounds.Location.X - 15, e.RowBounds.Location.Y + 4);
else
e.Graphics.DrawString((e.RowIndex + 1).ToString(), this.Font, brushes, e.RowBounds.Location.X + 15, e.RowBounds.Location.Y + 4);
}
}