Somashree
-
5/29/2012 10:56:22 AM
FieldInfo.CaptionStyle not working on custom form control
I have created a custom form control for use in my Kentico bizform using asp.net and I want to change the field caption style of another field in the form depending upon the value in my custom form control field. So, this is what I have done:
protected void ddl_SelectedIndexChanged(object sender, EventArgs e) { if(this.Value == "1") { FormEngineUserControl formItem = (FormEngineUserControl)this.Form.FieldControls["Other"]; formItem.FieldInfo.CaptionStyle = "font-weight:bold"; } }
However, the field caption in the form doesn't seem to get bolded. I tried testing if the event even fires and it does. Infact, if I try something like formItem.Value = "Something" then the texbox gets filled with "Something". So, there is something wrong with the captionstyle property or the way I am using it. How do I get it to work?
(Please note that the field control "Other" is a text box input and I have defined Value as a Property that gets the value selected in the drop down list)
|