HI, I'm trying to validate values on a radgrid when I do an insertion.
The validation all works fine on the ItemCommand Event below, however if the value I want to insert already exists I wish to cancel the insertion and close the edit box. The insertion is cancelled however the edit/insert box remains open.
I use the
RadGrid1.MasterTableView.ClearEditItems();
RadGrid1.Rebind();
to clear the edititems however the editmode stays open e.KeepInEdit mode is not available at this stage, how do I close the edit boxes
Thanks
Robert
if (baseline.BaselineExists(id, Convert.ToInt32(dayDateId), start, end, baselineType))
{
if (e.CommandName == RadGrid.PerformInsertCommandName)
{
gridMessage = "this baseline cannot be inserted. Reason: a baseline already exists for this day and time";
}
else
{
gridMessage = "baseline " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["id"] + " cannot be updated. Reason: a baseline already exists for these times";
}
e.Canceled = true;
RadGrid1.MasterTableView.ClearEditItems();
RadGrid1.Rebind();
return;
The validation all works fine on the ItemCommand Event below, however if the value I want to insert already exists I wish to cancel the insertion and close the edit box. The insertion is cancelled however the edit/insert box remains open.
I use the
RadGrid1.MasterTableView.ClearEditItems();
RadGrid1.Rebind();
to clear the edititems however the editmode stays open e.KeepInEdit mode is not available at this stage, how do I close the edit boxes
Thanks
Robert
if (baseline.BaselineExists(id, Convert.ToInt32(dayDateId), start, end, baselineType))
{
if (e.CommandName == RadGrid.PerformInsertCommandName)
{
gridMessage = "this baseline cannot be inserted. Reason: a baseline already exists for this day and time";
}
else
{
gridMessage = "baseline " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["id"] + " cannot be updated. Reason: a baseline already exists for these times";
}
e.Canceled = true;
RadGrid1.MasterTableView.ClearEditItems();
RadGrid1.Rebind();
return;