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

[Solved] Auto Insert and leave new row in Edit mode?

1 Answer 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James B Furlong
Top achievements
Rank 1
James B Furlong asked on 04 Aug 2009, 05:24 PM
I automatically set radgrid into Insert mode using IsItemInserted = true on entering a page and then, using the ItemDataBound event, I populate GridDataItemInsert fields from Session. This works well however, when the grid is rendered it displays the fields as labels (not editable) together with the Insert and Cancel buttons. This is not the behaviour I desire, I need the row to be in Edit mode to allow the user to override the values and then select "Insert"

Additionally, I have used the InitInsertCommandName in the ItemCommand event which gives the required edit row behaviour but this requires the user to select a header "Add New item" button which I want to avoid.

How can I get the successfully added GridDataItemInsert to be displayed in Edit mode please?

Brian


1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 07 Aug 2009, 08:56 AM
Hello Brian,

Thank you for your interest in our products.

I suggest that you add
if ( !this.IsPostBack ) 
{                 
    for (int i = 0; i < this.RadGrid1.MasterTableView.Items.Count; i++) 
             this.RadGrid1.MasterTableView.Items[i].Edit = true
    this.RadGrid1.MasterTableView.Rebind(); 
in your code to set all items in edit mode.

Sincerely yours,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
James B Furlong
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or