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

How to open a new row in edit mode for RadGrid inline editing

1 Answer 233 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 26 Feb 2011, 08:29 AM
Hi,

I have a requirement wherein I need to open a new row in insert mode in a RadGrid with inline editing. This should be done from my C# code. A button event on my page will cause this new row to be added and a GridBoundColumn whose TextControl is rendered should be prepopulated with some text. I tried doing Grid1.EditIndexes.Add(countOfItems) but to no sucess. I think the EditIndexes property is used to open up an existing record in update mode. I am using a DataTable to bind the DataSource.

Thanks In Advance.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 28 Feb 2011, 08:03 AM
Hello David,

If you want to open a new record in insert mode from an external event, try the following code snippet.

C#:
protected void Button1_Click(object sender, EventArgs e)
  {
      RadGrid1.MasterTableView.IsItemInserted = true;
      RadGrid1.Rebind();
  }

Thanks,
Princy.
Tags
Grid
Asked by
Dennis
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or