Thursday, October 1, 2009
How to Prevent Deletion Of Record From ListView
In This Controller That Record is Deleted Whose BillNo is Null
Write a Controller and Inherit : DeleteObjectsViewController
protected override void Delete(SimpleActionExecuteEventArgs args)
{
if (View.ObjectTypeInfo.Type == typeof(DispatchRegister))
{
List list = new List();
foreach (DispatchRegister item in args.SelectedObjects)
{
if (item.BillNo==null || item.BillNo.Length<=0)
{
list.Add(item);
}
}
if (list.Count == 0)
{
XtraMessageBox.Show("Record Can Not be Deleted. You Can Delete Only those Record whose Bill No is Blank");
}
else
{
BaseDelete(list);
}
return;
}
base.Delete(args);
}
private void BaseDelete(System.Collections.IList argsSelectedObjects)
{
ObjectSpace.Delete(argsSelectedObjects);
if (AutoCommit || View.IsRoot)
{
ObjectSpace.CommitChanges();
}
if (View is ListView)
{
((ListView)View).Editor.Refresh();
}
else
{
View.Close();
}
}
Subscribe to:
Post Comments (Atom)
Mat Table Angular
Mat Table in Angular Mat table is used to display data . its a material designed styled data-table . For using Material Table MatTableMo...
-
CriteriaOperator criteria = new BinaryOperator("Age", 30, BinaryOperatorType.Greater); CriteriaOperator criteria = CriteriaOperato...
-
SortingCollection sc = new SortingCollection(); sc.Add (new SortProperty("field on which you want to sort",DevExpress.Xpo.DB.Sorti...
-
Minification and Uglyfication in Angular Deployement Minification : While building Angular Application white spaces , unused variable , u...
No comments:
Post a Comment