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

Master / Child Updates

1 Answer 93 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 07 Jul 2010, 12:12 AM

Please point me to (a) sample(s) to distinguish in the insert or update between a master / child the current selection is on.

        private void radGridView1_RowsChanged(object sender, GridViewCollectionChangedEventArgs e)  
        {  
            case ... I'm changing in the master... // what is the selection
            this.t_FilmTableAdapter.Update(this.pAS2DataSet.T_Film);  
            case .... I'm changing a child    //how do you select it
            case .... another child
            end case
        } 

Now, if I have scenes (as a child) and the child template works and I just wanted to update the scene row - where or how do I differentiate that?

Thanks in advance,
Karl

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 14 Jul 2010, 02:44 PM
Hello Karl Golling,

Thank you for your question.

You can define whether you are working with master or child rows by checking their template. For example, in the RowsChanged event you can use the received event arguments:

private void radGridView1_RowsChanged(object sender, GridViewCollectionChangedEventArgs e)
{
    if (e.GridViewTemplate == this.radGridView1.MasterGridViewTemplate)
    {
        // working with master template rows
    }
    else
    {
        // working with child template rows
    }
}

I hope it helps in your case.

Greetings,
Alexander
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
Karl
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or