RadGrid Insert new row

2 posts, 0 answers
  1. Manuel
    Manuel avatar
    1 posts
    Member since:
    Sep 2012

    Posted 18 Feb 2012 Link to this post

    Hello!!!

    I have a project with radGrid,

    Before to add new record I want to add some values on hiding columms;

     protected void RadGrid1_ItemInserted(object sender, Telerik.Web.UI.GridInsertedEventArgs e)
        {

      e.NewValues["IpAddress"] = GetIpAddress();

                    e.newvalues["dateandtime"] =date.now;

        }

    on deveexpress i use the e.newvalues[""] how can i do on telerik?

    all I want is add some info before to insert.

    Thansk.

  2. Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 22 Feb 2012 Link to this post

    Hello Manual,

    You could implement similar scenario by creating a Dictionary property and storing the associated data there. I have assembled a example to show how the desired functionality could be achieved.
    private Dictionary<GridEditableItem, object> newValues = new Dictionary<GridEditableItem,object>();
    protected void RadGrid1_ItemInserted(object sender, Telerik.Web.UI.GridInsertedEventArgs e)
    {
        newValues[e.Item] = DateTime.Now;
    }

    Regards,
    Antonio Stoilkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top