try to enable a button inside <telerik:RadListView>

1 posts, 0 answers
  1. sharon
    sharon avatar
    26 posts
    Member since:
    Jul 2015

    Posted 23 Jul Link to this post

    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

     

     

Back to Top