Hi! can anyone help me with this.
i am using a radgrid and i set its edit mode into editforms. when i click the edit button, the items are edited, which is fine. the items are 3 GridNumericColumn, 1 GridTemplateColumn and 1 GridBoundColumn. in the template column is a asp dropdownlist. all i want to happen is when i click the dropdownlist and select specific item on it, it will disable the other fields. then if i select another, it will enable the other 2 numeric boxes.
some codes below.
protected
void dgNumeric_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
if (((string)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Title"]).ToUpper() == "Between".ToUpper() ||
((
string)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Title"]).ToUpper() == "Not Between".ToUpper())
{
(e.Item
as GridEditableItem)["PropertyName"].Enabled = false;
}
else
{
(e.Item
as GridEditableItem)["RangeFrom"].Enabled = false;
(e.Item
as GridEditableItem)["RangeTo"].Enabled = false;
}
GridEditableItem editedItem = e.Item as GridEditableItem;
DropDownList list = editedItem.FindControl("ddlValue") as DropDownList;
list.Text = ((
string)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Title"]);
}
}