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

Add New Row/Multple Insert

1 Answer 212 Views
GridView
This is a migrated thread and some comments may be shown as answers.
heavywoody
Top achievements
Rank 1
heavywoody asked on 04 Aug 2010, 09:26 PM
Just wanted to say I love your guys controls and support.  I use them for about everything.  I have been using the Infragistics grid only because up until this release, they seemed to have strong Excel-like Copy/Paste functionality.  So I am using the Gridview with WPF.

My question is this. I would like there to always be a new row available to add at the top, like the Infragistics Gridview.  Another reason why this is so important is that in some cases, my users might select 10 rows in Excel, copy them, click on the New Row and click paste, and it will insert as many rows needed and then always have an available row again to Add New Row.

Is this possible with your Gridview?  I see how you can add a button that adds a new row, but I want it to always be there and then be able to paste multiple rows into the grid. I am trying to get it as much like Excel as possible.

1 Answer, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 09 Aug 2010, 09:59 AM
Hello Christian Loepp,

 If you want to paste rows from the Clipboard as new rows in the RadGridView, you can handle the Pasting event in the following way:

private void radGridView1_Pasting(object sender, GridViewClipboardEventArgs e)
{
    var newItem = this.radGridView1.Items.AddNew();
    this.radGridView1.SelectedItem = newItem;
}

Pasting always starts from the first selected item, or from the first row if no items are selected.

On a side note, you can try setting ShowInsertRow on RadGridView to true, which should work for most of your other needs.

All the best,
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
heavywoody
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Share this question
or