Hello,
I wish that as value of property values change in my editor. For example I pass a value to the ID property, I would like with Red or Blue as a possibility and if I go 2 in value to the property ID, I would like to have Green and Black. Is this possible?
In my form
In my class PropertyGridSamEditor :
Regards
I wish that as value of property values change in my editor. For example I pass a value to the ID property, I would like with Red or Blue as a possibility and if I go 2 in value to the property ID, I would like to have Green and Black. Is this possible?
In my form
private
void
radPropertyGrid1_EditorRequired(
object
sender, PropertyGridEditorRequiredEventArgs e)
{
if
(e.Item.Name ==
"TestSam"
)
{
PropertyGridSamEditor test =
new
PropertyGridSamEditor();
test.id = 1;
e.EditorType = test.GetType();
}
}
In my class PropertyGridSamEditor :
public
class
PropertyGridSam2Editor : BaseInputEditor
{
public
PropertyGridSam2Editor(
)
{
m_ID = 0;
}
public
int
m_ID {
get
;
set
; }
public
PropertyGridSam2Editor(
int
ID)
{
m_ID = ID;
}
public
override
object
Value
{
get
{
RadDropDownListElement editor = (RadDropDownListElement)
this
.EditorElement;
List<InfoSam> Isam =
new
List<InfoSam>();
if
(m_ID == 0)
{
Isam.Add(
new
InfoSam(1,
"Rouge"
));
Isam.Add(
new
InfoSam(2,
"Bleu"
));
}
else
{
Isam.Add(
new
InfoSam(3,
"Bleu"
));
Isam.Add(
new
InfoSam(4,
"Noir"
));
}
editor.DisplayMember =
"Couleur"
;
editor.SelectedValue =
"ID"
;
editor.DataSource = Isam;
return
editor.Text;
}
set
{
RadDropDownListElement editor = (RadDropDownListElement)
this
.EditorElement;
if
(value !=
null
&& value != DBNull.Value)
{
editor.Value = value.ToString();
}
else
{
editor.Value =
"1"
;
}
}
}
}
Regards