This is a migrated thread and some comments may be shown as answers.

try to enable a button inside <telerik:RadListView>

0 Answers 140 Views
ListView
This is a migrated thread and some comments may be shown as answers.
sharon
Top achievements
Rank 1
sharon asked on 23 Jul 2016, 07:54 AM

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

 

 

No answers yet. Maybe you can help?

Tags
ListView
Asked by
sharon
Top achievements
Rank 1
Share this question
or