Custom Bind Multiple Files in Custom DataGridViewColumn (WinForms)

I have a question about binding data (multiple properties) to a custom DataGridViewColumn. Here is a diagram of what controls I have, and I need to make it related to this DataGridView datasource. Any ideas or a link to an article discussing this issue?

Control

  • Graph Control (Custom): Displayed in the Custrom DataGridView column. has properties such as "Start Date", "EndDate", "Manage Windows Chart", which in itself, a binder, etc.
  • A custom cell (DataGridViewCustomCell inherits from a DataGridViewCell) that contains the Chart controls and processes some events (the OnEnter event, for example, transfers focus to a custom chart column for drag-n-drop type events, etc.).
  • A custom column (DataGridViewCustomColumn inherits from DataGridViewColumn) that defines the type of cell template: CellTemplate = new DataGridViewCustomCell (); as well as the primary choice for data binding

Data structure:

  • The main table displayed in other columns of the DataGridView
  • Chart table - associated with the main table through parent-child relationships. Saves graph data.
  • Chart table associated with a graphic table through parent-child relationships. Saves data for a win-form chart, which is part of my graphics management.

Graph Graph Graph-holding Column/Cell.

+3
2

. SQL, datagridview win- ( , ).

, , , , , , .:-)

( 1-2 MS) 1. , DataGridViewColumn DataGridViewCell, ; 2. "CustomEdit"

  1. , , , DataRow , , . .

:

public partial class MyCell : DataGridViewCell 
 {
    protected override void Paint(...)
        {...} // draws control
              // receives data item as a value 
              // in my case I have to custom-draw entire control in this fnc.
    public override void InitializeEditingControl(...)
        {...} // initialize control editing
    // override some other properties
    public override Type EditType {
        get{ 
           return typeof(MyEditControl);
        }
    }
    public override Type ValueType{
        get{
           return typeof(MyItem);
        }
    }
 }

:

public partial class MyColumn : DataGridViewColumn
{
    public MyColumn(){ ...
    CellTemplate = new MyCell();
    }
}

:

public partial class MyEditControl : UserControl, IDataGridViewEditingControl
{... // implements IDataGridViewEditingControl
     // value is our data item
}

, List <MyItem>

public class MyItem:Object{
    ...
    [XmlIgnore] // I need it because I do serialization
    public MyItem Self {
        get {
            return this;
        }
    }
 }
+2

, IDE , . , , , . , , , .

: sql, datagridview

0

All Articles