Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

try to enable a button inside

$
0
0

Hi!

   I have a RadListView control that holds data, based on a condition, I need to set elements inside of the RadListview to be read only or editable.  But, there are 2  buttons need to be enabled all the time, in RadLVFbData_ItemDataBound, I first set all the elements in <div> to be disabled, then try to enable the 2 buttons, I have tried several ways, but was not able to make the 2 buttons enabled, however, i was able to change the color.  Any suggestions?  code as below.

Thanks in advanced! SH.

                           foreach (Control ctrl in divBoxBody.Controls)
                            {
                                if (ctrl is WebControl)
                                    ((WebControl)ctrl).Enabled = false;
                                else if (ctrl is HtmlControl)
                                    ((HtmlControl)ctrl).Disabled = true;
                            }
                            Button oElemBtnSubmit = item.FindControl("btnSubmit") as Button;
                            #1. oElemBtnSubmit.Attributes.Add("Disabled", "Disabled"); => not work
                            #2. oElemBtnSubmit.Attributes.Remove("Disabled"); => not work
                            #3. oElemBtnSubmit.Enabled = true; => not work
                            #4. oElemBtnSubmit.Style.Add("color", "#008888"); =>  successfully

 

 


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>