Insert / update grid

2 posts, 0 answers
  1. Michael Nagy
    Michael Nagy avatar
    18 posts
    Member since:
    May 2008

    Posted 01 Feb 2009 Link to this post

    Hello ,
    I am using radGrid using insert / update edit form , i want to use AutoGenerated  EditFormType at update and user Template EditFormType at insert .. if this possible ???
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 01 Feb 2009 Link to this post

    Hello Michael,

    You can try out the following code to display different EditForms on edit and insert modes of the grid:
    cs:
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
        { 
           if (e.CommandName == RadGrid.InitInsertCommandName) 
            { 
                e.Canceled = true
                RadGrid1.EditIndexes.Clear(); 
                e.Item.OwnerTableView.EditFormSettings.EditFormType = GridEditFormType.Template;             
                e.Item.OwnerTableView.InsertItem(); 
            } 
            else if (e.CommandName == RadGrid.EditCommandName) 
            { 
                e.Item.OwnerTableView.IsItemInserted = false
                e.Item.OwnerTableView.EditFormSettings.EditFormType = GridEditFormType.AutoGenerated; 
            } 
       } 

    Thanks
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top