Custom Update in RadGrid

3 posts, 0 answers
  1. archimede
    archimede avatar
    103 posts
    Member since:
    Jul 2006

    Posted 27 May 2010 Link to this post

    I have a radGrid that shows data from an ObjetDataSource (a query with a join between multiple tables). I have defined on the grid the DataKeyValues (IdCultura, IdMaschera, Nome) and I want to catch a text field inserted by user:

    protected void RadGridNomiMaschere_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
        { 
            switch (e.CommandName) 
            { 
                case "Update"
     
                    long idCultura = (long)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["IdCultura"]; 
                    long idMaschera = (long)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["IdMaschera"]; 
                    string nome = (string)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Nome"]; 
                     
                    break
            } 
        } 

    In particular I want to retrieve the edited "Nome" field in grid. In this event I catch correctle the IdCultura and IdMaschera but always the old value and not the new one inserted by user. Why?


  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 May 2010 Link to this post

    Hi,

    I hope the documentation (which elaborates how to fetch the new values which the user entered), will give some insight on this.

    Retrieving original values for edited item

     

    -Shinu.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. archimede
    archimede avatar
    103 posts
    Member since:
    Jul 2006

    Posted 27 May 2010 Link to this post

    My problem is not to retrieve an old value. I want to use in code the edited field value inserted in edit mode by the user.
Back to Top