This is a migrated thread and some comments may be shown as answers.

Insert / update grid

1 Answer 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael Nagy
Top achievements
Rank 2
Michael Nagy asked on 02 Feb 2009, 12:32 AM
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 ???

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Feb 2009, 04:18 AM
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.
Tags
Grid
Asked by
Michael Nagy
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or