While the grid is insert mode , I need to disable some controls in this mode. I found the code for disabling in edit mode but not in insert mode , can someone help me
protected void DropDownparamType_SelectedIndexChanged(object sender, EventArgs e) { |
DropDownList DDL = (DropDownList)sender; |
GridIndexCollection EditItems = RadGrid1.EditIndexes; |
if (EditItems.Count > 0) { |
GridDataItem Item = (GridDataItem)RadGrid1.Items[EditItems[0]]; |
GridEditFormItem ItemEdit = (GridEditFormItem)Item.EditFormItem; |
/*Habilitar el campo de valores aceptados únicamente cuando el tipo de parámetro es LIST*/ |
if ((object)ItemEdit["acceptedValues"].FindControl("txtacceptedValues") != null) { |
TextBox acceptedValues = (TextBox)ItemEdit["paramType"].FindControl("txtacceptedValues"); |
if (DDL.SelectedValue == "3") {//Tipo Lista |
acceptedValues.Enabled = true; |
acceptedValues.BackColor = System.Drawing.Color.White; |
} |
else { |
acceptedValues.Enabled = false; |
acceptedValues.BackColor = System.Drawing.Color.FromArgb(204, 204, 204);//#CCCCCC |
} |
} |
} |
} |
Thanks in advance