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

How to obtain reference to GridViewRow from underlying data object?

1 Answer 34 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 28 Apr 2011, 02:14 AM

How can I obtain a reference to a GridViewRow given the underlying data object?

 

 

 

 

private void btnAdd_Click(object sender, RoutedEventArgs e)

 

 

{

 

 

 

    CounterParty counterParty = this._viewModel.InsertNewItem();

 

 

 

 

    GridViewRow gvr = "...";
}

The ultimate objective is to call BeginEdit on the row after insert.

Thanks!

 

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 28 Apr 2011, 10:08 AM
Hello Brian,

You should just set the newly added item as CurrentItem and call BeginEdit on the grid:

// set the newly added row as current
this.playersGrid.CurrentItem = counterParty;
// initiate edit operation
this.playersGrid.BeginEdit();

Regards,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Brian
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or