Property Descriptor

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use a propertydescriptor to alter the color of a column in a
DataGrid. I have a button1 on the form that has a red color and I want to
copy this red color property (forecolor) to my DataGridTextBoxColumn.
However, it just ignores it.
Dim pdc As PropertyDescriptorCollection =
TypeDescriptor.GetProperties(Button1)
Dim c2 As DataGridTextBoxColumn = New DataGridTextBoxColumn(pdc.Find
("ForeColor", False))

Is this even possible?
 
Hi,

You need to create your own datagrid textbox column to change the
back color. Here is an example.
http://www.onteorasoftware.com/Downloads/coloredcolumns.zip

Ken
-------------------
I am trying to use a propertydescriptor to alter the color of a column in a
DataGrid. I have a button1 on the form that has a red color and I want to
copy this red color property (forecolor) to my DataGridTextBoxColumn.
However, it just ignores it.
Dim pdc As PropertyDescriptorCollection =
TypeDescriptor.GetProperties(Button1)
Dim c2 As DataGridTextBoxColumn = New DataGridTextBoxColumn(pdc.Find
("ForeColor", False))

Is this even possible?
 

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

Back
Top