Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Refer othr properties in the contrl in getstandardvaluecollection

Reply
Thread Tools

Refer othr properties in the contrl in getstandardvaluecollection

 
 
Venkat
Guest
Posts: n/a
 
      01-20-2006
Hi

I am writing a webcontrol, that has two properties, both are strings. Based
on the value of the first property, I want set the default values of the
second property. I am trying to set the default values of the second property
using typeconverter that inherits stringconverter and overriding
GetStandardValueCollection. In the method GetStandardValueCollection , How do
I referece prop1 (use the value of prop1)?.

Thanks
 
Reply With Quote
 
 
 
 
Venkat
Guest
Posts: n/a
 
      01-20-2006
Here is the example of what I am trying to accomplish

public class TestControl :WebControl {

private string _firstprop;
private string _secondprop;

[Category("Default")]
public string FirstProperty {
get { return _firstprop;}
set { this._firstprop=value;}
}


[TypeConverter(typeof(CusPropConverter)),
Category("Default")]
public string SecondProperty {
get { return _secondprop;}
set { this._secondprop=value;}
}














internal class CusPropConverter : StringConverter {



public override bool GetStandardValuesSupported(
ITypeDescriptorContext context) {
return true;
}

public override bool GetStandardValuesExclusive(
ITypeDescriptorContext context) {
// returning false here means the property will
// have a drop down and a value that can be manually
// entered.
return false;
}

public override StandardValuesCollection GetStandardValues(
ITypeDescriptorContext context) {


///Here I want to get the value of FirstProp and use to create a array of
strings



return ;

}


}


Can you please guide me how to do it?

Thanks




"Venkat" wrote:

> Hi
>
> I am writing a webcontrol, that has two properties, both are strings. Based
> on the value of the first property, I want set the default values of the
> second property. I am trying to set the default values of the second property
> using typeconverter that inherits stringconverter and overriding
> GetStandardValueCollection. In the method GetStandardValueCollection , How do
> I referece prop1 (use the value of prop1)?.
>
> Thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
is there a way to refer to public properties in other user controls Web Search Store ASP .Net Web Controls 11 04-23-2008 07:00 PM
is there a way to refer to public properties in other user controls Web Search Store ASP .Net Web Services 11 04-23-2008 07:00 PM
is there a way to refer to public properties in other user controls Web Search Store ASP .Net 11 04-23-2008 07:00 PM
Can other C# contrl display HTML without WebBrowser? Aiver ASP .Net Web Controls 1 03-13-2008 04:49 PM
Making Custom Control Properties Visible in Visual Studio's Properties Palette Nathan Sokalski ASP .Net 0 10-17-2005 02:05 AM



Advertisments