Ana içeriğe geç

Detay Tablo İçerisindeki Nesnelerin Buton ile Readonly Yapılması

using System.Web.UI.WebControls; 
    public void Button1_OnClick(Object sender, EventArgs e)
{

if(DetailsGrid1.CurrentRowCount > 0)

{
for(int i=0;i<DetailsGrid1.CurrentRowCount;i++)
{
((TextBox)DetailsGrid1.GetRowObject(i,"Text1")).ReadOnly =true;

((eBADateTimeBox)DetailsGrid1.GetRowObject(i,"Text2")).ReadOnly = true;

((DropDownList)DetailsGrid1.GetRowObject(i,"List1")).Attributes.Add("disabled","disabled");

((eBAComboBox)DetailsGrid1.GetRowObject(i,"List2")).ReadOnly = true;

//((DropDownList)DetailsGrid1.GetRowObject(i,"List6")).Attributes.Remove("disabled"); //Readonly kaldırmak için

}
}
}