radgrid changes

2 posts, 0 answers
  1. JOSE MANUEL PÉREZ RAMÍREZ
    JOSE MANUEL PÉREZ RAMÍREZ avatar
    22 posts
    Member since:
    Jan 2008

    Posted 29 May 2008 Link to this post

    Is possible know changed rows in radgrid?

    And row's  unlederlaying object?

  2. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 29 May 2008 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top