Click or drag to resize

IRecroGridDeleteRecroGridDelete Method

Method of deleting data.

Namespace:  Recrovit.RecroGridFramework
Assembly:  Recrovit.RecroGrid (in Recrovit.RecroGrid.dll) Version: 6.0.0
Syntax
C#
bool RecroGridDelete(
	IRGDataContext context,
	RGClientParam param,
	RGUIMessages messages
)

Parameters

context
Type: Recrovit.RecroGridFramework.DataIRGDataContext
The context.
param
Type: Recrovit.RecroGridFrameworkRGClientParam
Parameters.
messages
Type: Recrovit.RecroGridFrameworkRGUIMessages
Returning messages.

Return Value

Type: Boolean
true if deletion is valid, otherwise false.
Examples
C#
public partial class Person : IRecroGridInitNew, IRecroGridUpdate, IRecroGridDelete
{
    public bool RecroGridDelete(IRGDataContext context, RGClientParam arg, RGUIMessages messages)
    {
        if (this.Locked)
        {
            messages.AddError("A rekord zárolt!");
            return false;
        }
        return true;
    }
    public void RecroGridInitNew(IRGDataContext context, RGClientParam arg)
    {
        this.PersonType = "SC";
    }
    public bool RecroGridUpdate(IRGDataContext context, RGClientParam arg, RGUIMessages messages)
    {
        if (string.IsNullOrEmpty(this.FirstName))
        {
            //mezőhöz kapcsolt hibaüzenet RecroDict szótárból
            messages.AddError(RecroDict.Get(arg.HttpContext, "Person.Validation", "FirstName"), RecroGrid.Alias2ClientName(arg.RGProperties, "FirstName"));
        }
        if (string.IsNullOrEmpty(this.LastName))
        {
            messages.AddError(RecroDict.Get(arg.HttpContext, "Person.Validation", "LastName"), RecroGrid.Alias2ClientName(arg.RGProperties, "LastName"));
        }
        return messages.ErrorCount == 0;
    }
}
See Also