Why property does not appear in TEST Container :-(

A

--== Alain ==--

Hi,

I have a huge problem...
My property does not appear in the "propertyGrid" of "test Container",
when i test my custom control.

Here is the custom control code :

namespace ARListView.Design
{
[DesignTimeVisible(true),
ToolboxItem(true),
ToolboxBitmap(typeof(ARListView.Design.CARListView),"CARListView.bmp")]
public partial class CARListView : UserControl
{
....
#region Properties - ListView

#region Property : GridLines
[Category("Appearance"),
Browsable(true),

DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
Description("Setup Style, Type and Color of gridlines to draw.")]
[TypeConverter(typeof(CGridLineConverter))]
public CGridLine GridLines
{
get
{
return this.m_GridLines;
}
set
{
if (value != this.m_GridLines)
{
if (value != null)
{
this.m_GridLines = value;
}
}
}

}
....
}

if i do not place the [TypeConverter(typeof(CGridLineConverter))]
and / or
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),

my property is displayed but the whole field is colored in black.

What could be the problem ?
thanks a lot,

Al.
 
A

--== Alain ==--

Hi,

Here is the detailed issue.

Here is my custom control class definition :
[Category("Appearance")]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Description("Setup Style, Type and Color of gridlines to draw.")]
[TypeConverter(typeof(CGridLineConverter))]
public CGridLine GridLines
{
....
}

and here is my TypeConverter class :
public class CGridLineConverter : ExpandableObjectConverter
{
....
}

and my CGridLine class :
public class CGridLine
{
....
}

When i test m custom control in TestContainer i have the following behavior.

test 1.
If i test it like that, the property "GridLines" from my custom control
is not displayed in the propertyGrid of TestContainer window.

test 2.
If i comment the line
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
and
[TypeConverter(typeof(CGridLineConverter))]
the property "GridLines" is displayed but disable (tge same for its
value field)

test 3.
If i comment the line
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
and
[TypeConverter(typeof(CGridLineConverter))] is not commented.
the "GridLines" property is disbled, but its value field is colored in
black (the full cell in property Grid)

test 4.
If
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
is not commented
and
[TypeConverter(typeof(CGridLineConverter))] is commented

the "GridLines" property is displayed as accessible, but its value field
displays : ARListView.Design.CGridLine

which correspond to Namespace1.Namespace2.ClassName of my property.

So where is the problem ?
Why property is not displayed when both attributes are "not commented",
so active ?

It's already 4 days that i'm searching and searching without finding
some reason.

thanks a lot for your help,

Al.


--== Alain ==-- said:
Hi,

I have a huge problem...
My property does not appear in the "propertyGrid" of "test Container",
when i test my custom control.

Here is the custom control code :

namespace ARListView.Design
{
[DesignTimeVisible(true),
ToolboxItem(true),
ToolboxBitmap(typeof(ARListView.Design.CARListView),"CARListView.bmp")]
public partial class CARListView : UserControl
{
...
#region Properties - ListView

#region Property : GridLines
[Category("Appearance"),
Browsable(true),

DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
Description("Setup Style, Type and Color of gridlines to draw.")]
[TypeConverter(typeof(CGridLineConverter))]
public CGridLine GridLines
{
get
{
return this.m_GridLines;
}
set
{
if (value != this.m_GridLines)
{
if (value != null)
{
this.m_GridLines = value;
}
}
}

}
...
}

if i do not place the [TypeConverter(typeof(CGridLineConverter))]
and / or
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),

my property is displayed but the whole field is colored in black.

What could be the problem ?
thanks a lot,

Al.
 

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