473,382 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

DefaultPropertyAttribute

Hi,

I've created this control to hold name and template:
<Controle Id="ctrl" Nome="Header">
<Template>
Bla Bla .....
</Template>
</Controle>

But i want to set the Template property as default property:

<Controle Id="ctrl" Nome="Header">
Bla Bla .....
</Controle>

I used:
[DefaultProperty("Template"),ParseChildren(false)]
public class Controle
{
...

public ITemplate Template {...}
}

But it doesn't work, the property is not set, what is wrong?

Thanks.
Pietro
Nov 19 '05 #1
1 1794
You need to also set the [PersistenceMode(PersistenceMode.InnerDefaultProper ty)]
on the Template property.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

I've created this control to hold name and template:
<Controle Id="ctrl" Nome="Header">
<Template>
Bla Bla .....
</Template>
</Controle>
But i want to set the Template property as default property:

<Controle Id="ctrl" Nome="Header">
Bla Bla .....
</Controle>
I used:
[DefaultProperty("Template"),ParseChildren(false)]
public class Controle
{
...
public ITemplate Template {...}
}
But it doesn't work, the property is not set, what is wrong?

Thanks.
Pietro


Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kevin Phifer | last post by:
I think that I have found that this is not supported in .net (either vb.net or c#). I would like to have my old default method attribute when I built "classes" in vb6. Is this possible?
2
by: Mike in Paradise | last post by:
Can you use the DefaultValueAttribute on Decimal PropertyFields? If so what is format for setting the Default value. Thanks... Example /// <summary> /// Field: increment value ///...
0
by: Brian Young | last post by:
Hi all. I'm using the Property Grid control in a control to manage a windows service we have developed here. The windows service runs a set of other jobs that need to be managed. The control...
3
by: Water Cooler v2 | last post by:
Is there support for designating a method of a class as the class' default method? I believe there is some attribute that you append to the method. Some or or something I guess. Can't remember.
3
by: --== Alain ==-- | last post by:
Hi, I would like to have a property of image type. i've seen on official .NET component that several controls have such properties. My component is built under VC++.NET and not under C#,...
2
by: --== Alain ==-- | last post by:
Hi, I would like to define the default value of my property. My property is from type Bitmap^, therefore i was thinking to do : but i does not work. how is it possible to define this...
2
by: SparkPlug | last post by:
Does anyone know how to initialize a DefaultPropertyAttribute for a object-type property, for example if you want to set the default value of a Font property to a particular font? E.g.: ...
5
by: Nikolay Belyh | last post by:
I have created a "collection" in C# like this: namespace ClassLibrary1 { public class X {} public class Class1 { public ArrayList objs {
10
by: Derek Hart | last post by:
I can set focus to my property grid by using propgrid.Focus - but how can I set the default property that is always first? Or just set focus to the default property? Can this be done?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.