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

Simple insert, update, delete in Grid

1 Answer 229 Views
GridView
This is a migrated thread and some comments may be shown as answers.
willi
Top achievements
Rank 1
willi asked on 09 Apr 2009, 09:26 AM
Hi again!

Today I was looking for an Solution to update, insert and delete rows in a grid without a Dataadapter.
I found a few threads, but in the most you told us to wait for the next Version of RadGrid an new Handling of events. (My actual version is Q1 2009)

I need a solution where I can user my own statements and parameters in a Radgrid.
I fill the grid with:
RadGridView1.MasterGridViewTemplate.LoadFrom(reader) 

I was logging the RowsChanging and RowsChanged events, but cannot find the right solution for my problem
For example: When I add a new row, the rowChanging event fires with e.action = Telerik.WinControls.Data.NotifyCollectionChangedAction.Add but then no Changing events with Telerik.WinControls.Data.NotifyCollectionChangedAction.ItemChanged is fired for this row

Then I tried to use the CellEndEdit- Event but cannot find a way to know that I'm in a new Row and so on...

Pleas help.

regards
Willi

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 10 Apr 2009, 03:00 PM
Hello willi,

Thank you for the question.

If I have understood your correctly, you want to know if you are editing the 'Add new row' row. In this case, you can use the CellEndEdit event and check if the CurrentCell.RowInfo is GridViewNewRowInfo:
Public Sub New()  
    InitializeComponent()  
 
    AddHandler radGridView1.CellEndEdit, AddressOf radGridView1_CellEndEdit  
End Sub 
 
Private Sub radGridView1_CellEndEdit(ByVal sender As ObjectByVal e As Telerik.WinControls.UI.GridViewCellEventArgs)  
    If TypeOf Me.radGridView1.CurrentCell.RowInfo Is GridViewNewRowInfo Then 
        Console.WriteLine("Your implementation here")  
    End If 
End Sub 

I hope this helps. If you have additional questions, feel free to contact me.

Regards,
Nikolay
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
willi
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or