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

radgrid changes

1 Answer 67 Views
GridView
This is a migrated thread and some comments may be shown as answers.
JOSE MANUEL PÉREZ RAMÍREZ
Top achievements
Rank 1
JOSE MANUEL PÉREZ RAMÍREZ asked on 29 May 2008, 07:10 AM

Is possible know changed rows in radgrid?

And row's  unlederlaying object?

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 29 May 2008, 08:19 AM
Hi Jose,

Thank you for this question.

You can get the row underlaying data object by using the DataBoundItem property.

Yes, it is possible to know whether a specific row in RadGridView has been changed, but it depends on the data source. If you are using a DataTable as an example, the DataBoundItem property contains an instance of a DataRowView object. You should use the IsEdit property of the DataRowView.

Consider the following method:

List<GridViewDataRowInfo> GetModifiedRows() 
    List<GridViewDataRowInfo> modifiedRows = new List<GridViewDataRowInfo>(); 
 
    foreach (GridViewDataRowInfo rowInfo in this.radGridView1.Rows) 
        if (rowInfo.DataBoundItem is DataRowView) 
        { 
            DataRowView dataRowView = (DataRowView)rowInfo.DataBoundItem; 
            if (dataRowView.IsEdit) 
            { 
                modifiedRows.Add(rowInfo); 
            } 
        } 
 
    return modifiedRows; 

I hope this helps. Please, contact me again, if you need further assistance.

Best wishes,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
JOSE MANUEL PÉREZ RAMÍREZ
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or