A
Arkion
Hello all!
I have an array of structs that acts as a datasource for a DataGrid
control. Public properties of this struct then become the columns of
the grid:
public struct Item
{
private Color color;
private String name;
public String ItemName
{
get { return this.name; }
set { this.name = value; }
}
public Color ItemColor
{
get { return this.color; }
set { this.color= value; }
}
}
I have subclassed DataGridColumnStyle and implemented a color editor.
The problem is, how do I replace the already existing ColumnStyle
(which is DataGridTextBoxColumn by default) of ItemColor column with
instance of my own DataGridColumnStyle class?
E.g.:
Item[] items = new Item[5];
....
gridCtrl.DataSource = items;
gridCtrl.DataMember = "";
// TODO: replace the style of ItemColor column here
I have an array of structs that acts as a datasource for a DataGrid
control. Public properties of this struct then become the columns of
the grid:
public struct Item
{
private Color color;
private String name;
public String ItemName
{
get { return this.name; }
set { this.name = value; }
}
public Color ItemColor
{
get { return this.color; }
set { this.color= value; }
}
}
I have subclassed DataGridColumnStyle and implemented a color editor.
The problem is, how do I replace the already existing ColumnStyle
(which is DataGridTextBoxColumn by default) of ItemColor column with
instance of my own DataGridColumnStyle class?
E.g.:
Item[] items = new Item[5];
....
gridCtrl.DataSource = items;
gridCtrl.DataMember = "";
// TODO: replace the style of ItemColor column here