Hi, Alessandro,
Try it this way:
public override bool Checked
{
get
{
object o = ViewState["Checked"];
if(o != null)
return (bool)o;
return false;
}
set
{
ViewState["Checked"] = value;
}
}
public string Scelto
{
get
{
return (Checked ? "S" : "N");
}
set
{
Checked = (value == "S");
}
}
Hope this helps
Martin
"Alessandro Rossi" <Alessandro
> wrote in
message news:6F26E5A6-D5AC-4286-A7FF-...
> Hi,
> I have to create a CheckBox, and i would like will be checked if there is
a
> value in a property added, and not checked if there is another value.
>
> I added 2 property (string) to the checkbox; the first , CheckedValue is
the
> value for whom i want the check will be checked. The second is the
opposite.
> I Added a handler to the checkbox in this way:
>
> this.DataBinding+=new EventHandler(AreaITWebCheckBox_DataBinding);
>
> and
>
> private void AreaITWebCheckBox_DataBinding(object sender, EventArgs e)
> {
> }
>
> I binded another new property (Valore) in this way:
>
> DataBinder.Eval(dsGestione1, "Tables[RUOLO].DefaultView.[0].IND_ADM")
> where IND_ADM can have value "S" or "N".
>
> The question is:
> How can i acced to the value of property Valore from the eventHandler?
> If this is not possible, how can I realize this component in another way?
>
> Sincerely
> Alessandro