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

How can we Bind a Selected Item value of a RadGridView to Another RadGridView?

1 Answer 33 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Helio
Top achievements
Rank 2
Helio asked on 13 Apr 2011, 05:06 PM
I have a two Grids, if i select a cell in Grid1 and when i try to add a new row in the Grid2 by using Show Insert Property, i want the selected item value from Grid 1 to one of the cells which is a DataColumn in the newly created row of  Grid2.

Can u help me how can i bind the value of Grid1 to Grid 2?

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 14 Apr 2011, 10:07 AM
Hi Helio,

A possible approach would be to handle the AddingNewDataItem event of Grid2 as follows:

private void Grid2_AddingNewDataItem(object sender, GridViewAddingNewEventArgs e)
        {
            var grid1SelectedItem = this.Grid1.SelectedItem as MyItem;
            e.NewObject = new MyItem() { Name = grid1SelectedItem.Name };
        }
 
Let me know whether it corresponds to your requirements. 

All the best,
Maya
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
Helio
Top achievements
Rank 2
Answers by
Maya
Telerik team
Share this question
or