Click or drag to resize

IRecroGridInitNewRecroGridInitNew Method

Call before initialization event.

Namespace:  Recrovit.RecroGridFramework
Assembly:  Recrovit.RecroGrid (in Recrovit.RecroGrid.dll) Version: 1.7.3
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 param, RGUIMessages messages)
    {
        if (this.Locked)
        {
            messages.AddError("A rekord zárolt!");
            return false;
        }
        return true;
    }
    public void RecroGridInitNew(IRGDataContext context, RGClientParam param)
    {
        this.PersonType = "SC";
    }
    public bool RecroGridUpdate(IRGDataContext context, RGClientParam param, RGUIMessages messages)
    {
        if (string.IsNullOrEmpty(this.FirstName))
        {
            //mezőhöz kapcsolt hibaüzenet RecroDict szótárból
            messages.AddError(RecroDict.Get(param.HttpContext, "Person.Validation", "FirstName"), RecroGrid.Alias2ClientName(param.RGProperties, "FirstName"));
        }
        if (string.IsNullOrEmpty(this.LastName))
        {
            messages.AddError(RecroDict.Get(param.HttpContext, "Person.Validation", "LastName"), RecroGrid.Alias2ClientName(param.RGProperties, "LastName"));
        }
        return messages.ErrorCount == 0;
    }
}
See Also