Click or drag to resize

IRecroGridInitNewRecroGridInitNew Method

Call before initialization event.

Namespace:  Recrovit.RecroGridFramework
Assembly:  Recrovit.RecroGrid (in Recrovit.RecroGrid.dll) Version: 2.6.0
Syntax
C#
void RecroGridInitNew(
	IRGDataContext context,
	RGClientParam param
)

Parameters

context
Type: Recrovit.RecroGridFramework.DataIRGDataContext
The context.
param
Type: Recrovit.RecroGridFrameworkRGClientParam
Data and parameters from client side.
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