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

[Solved] RadGridView.NewRow property

1 Answer 126 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
D. Omar
Top achievements
Rank 1
D. Omar asked on 09 Nov 2009, 09:35 PM
I am using the 2003.1109 internal build and need to know whether the row I am currently editing is new (i.e., it was just added via BeginInsert). According to the documentation, The RadGridView has a NewRow property but it does not seem to be there.

I also tried checking for the row to be of type GridViewNewRow and it looks like the row is always of type GridViewRow.

How can I find out if I am currently editing a new row?

Thanks in advance,

-OmarV

1 Answer, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 10 Nov 2009, 10:42 AM
Hi D. Omar,

I suppose that you need this when an object is about to be saved into the underlying data source. If this is your case you can use RowEditEndedEventArgs.EditOperationType property. Your code should look similar to this:

void radGridView_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
{
    if (e.EditOperationType == GridViewEditOperationType.Insert)
    {
        dataBase.Insert();
    }
    else
    {
        dataBase.Update();
    }
}

Hope this helps.

Best wishes,
Nedyalko Nikolov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
D. Omar
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Share this question
or