PropertyGrid + Combobox
http://www.rsdn.ru/Forum/?mid=1267835
вот только вопрос как мне теперь добавить в propertygrid combobox?
Пишу тут программку и вней связал datagridview и propertygrid почитав здесь
вот только вопрос как мне теперь добавить в propertygrid combobox?
Цитата:
Originally posted by sclif13
Пишу тут программку и вней связал datagridview и propertygrid почитав здесь http://www.rsdn.ru/Forum/?mid=1267835
вот только вопрос как мне теперь добавить в propertygrid combobox?
Пишу тут программку и вней связал datagridview и propertygrid почитав здесь http://www.rsdn.ru/Forum/?mid=1267835
вот только вопрос как мне теперь добавить в propertygrid combobox?
Смотри переписку
http://forum.codenet.ru/showthread.php?s=&threadid=30196
мне не подействиям нужно
мне нужно как тыкаешь на опцию с боку появляется стрелка вниз ее нажимаешь и вываливается
combobox со значениями из базы! тут как-то надо преобразовать propertygrid
Не понял, чем тебе тот вариант не устраивает? Ты просто заменяешь PropertyGrid'овый комбо на свой. Другие попытки разрулить PropertyGrid на combobox закончились ничем....
А через Typeconverter нельзя что-ли?
For example, if you have a string property that you want to limit to a few
choices, create a class like this:
public class MyConverter : StringConverter
{
public override bool GetStandardValuesSupported(ITypeDescriptorContext
context)
{
//true means show a combobox
return true;
}
public override bool GetStandardValuesExclusive(ITypeDescriptorContext
context)
{
//true will limit to list. false will show the list, but allow free-form
entry
return true;
}
public override
System.ComponentModel.TypeConverter.StandardValuesCollection
GetStandardValues(ITypeDescriptorContext context)
{
return new StandardValuesCollection(
new string[] { "entry1", "entry2", "entry3" });
}
}
Then hook it up to your property like this: (note the [TypeConverter]
attribute)
private string _myProp = "entry1";
[Browsable(true)]
[DefaultValue("entry1")]
[CategoryAttribute("Behavior")]
[TypeConverter(typeof(MyConverter))]
public string MyProp
{
get{ return _myprop;}
set{ _myprop = value;}
}