Replacing existing DataGridColumnStyle

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
 
J

Jeffrey Tan[MSFT]

Hi Arkion,

For this issue, I have replied to you in another post of you in this group.
Please follow up there, I will help you. Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top