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

GridViewNewRowInfo.DataBoundItem is null

3 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kevin Meyer
Top achievements
Rank 1
Kevin Meyer asked on 28 Mar 2008, 02:41 PM
When adding a new row (in line editing), the GridViewNewRowInfo.DataBoundItem is null even though it is bound to the underlying object.

Here's my situation: I'm binding a BindingList of objects to the grid's data source.  I'm implementing an MVP pattern where the Presenter listens to the binding list's AddingNew event and initializes the new object.  Prior to Q1 2008 beta, the initialization made in AddingNew was not reflected in the grid's new row (this seems to be fixed in Q1 08 beta).

I am also implementing cascading combo boxes (Country selection drives items in the State column).  The Presenter listens to ListChanged events and computes the available States when the object's Country changes.  The filtered list of States is added to the object (presentation model).  In RadGridView.CellBeginEdit, the view modifies the RadComboBoxEditor, reseting the State list source to the new filtered list in the presentation model.  This works for existing rows, but breaks for new rows since the new row's DataBoundItem is null.

3 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 28 Mar 2008, 03:13 PM
Hello Kevin,

The GridViewNewRowInfo is a special row used in the new row add functionality. Please use its DataRowInfo property and its DataBoundItem.

Contact me again if you need further assistance.

Best wishes,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Kevin Meyer
Top achievements
Rank 1
answered on 28 Mar 2008, 03:18 PM
Thank you for the prompt response.

Since GridViewNewRowInfo still has the DataBoundItem property, it would be helpful if it internally returned its DataRowInfo.DataBoundItem.
0
Julian Benkov
Telerik team
answered on 28 Mar 2008, 05:37 PM
Hi Kevin,

Thank you for your suggestions. We will implement them for the Q1 2008 release.

Thank you again Kevin.

Greetings,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Kevin Meyer
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Kevin Meyer
Top achievements
Rank 1
Share this question
or