Home Forums WinForms controls Xceed Grid for WinForms Very Large Dataset Reply To: Very Large Dataset

User (Old forums)
Member
Post count: 23064

I tried that and it was very slow. I found another of your posts witht he following code:

public class MyDataRow : Xceed.Grid.DataRow {
public MyDataRow() {}
public MyDataRow(MyDataRow template):base(template) {}
protected override Xceed.Grid.Row CreateInstance() { return new MyDataRow(this); }
protected override Xceed.Grid.Cell CreateCell(Xceed.Grid.Column parentColumn){ return new MyDataCell(parentColumn); }
protected override void PaintBackground(Xceed.Grid.GridPaintEventArgs e) {
using (Brush b = new SolidBrush(GetBackColorToPaint()))
e.Graphics.FillRectangle(b, e.ClientRectangle);
}
}

public class MyDataCell : Xceed.Grid.DataCell {
public MyDataCell() {}
public MyDataCell(MyDataCell template):base(template) {}
public MyDataCell(Xceed.Grid.Column parentColumn):base(parentColumn) {}
protected override Xceed.Grid.Cell CreateInstance() { return new MyDataCell(this); }
protected override void PaintBackground(Xceed.Grid.GridPaintEventArgs e) {
// do nothing
}
}

How do I do an rows.AddNew() with the inherited datarow class as I get a “Specified Cast is not valid” with the code below?
MyDataRow newRow = (MyDataRow)HeaderGrid.DataRows.AddNew();

Thanks.

Imported from legacy forums. Posted by Steve0212 (had 362 views)